-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Example for using angular-highlightjs with browserify. #39
- Loading branch information
Showing
6 changed files
with
813 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!DOCTYPE html> | ||
<html ng-app="exampleApp"> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<title>JSON pretty print with AngularJS</title> | ||
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.0/css/bootstrap.min.css"> | ||
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/tomorrow.min.css"> | ||
<link rel="stylesheet" href="style.css" /> | ||
|
||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/highlight.min.js"></script> | ||
|
||
<script src="scripts/bundle.js"></script> | ||
</head> | ||
|
||
<body ng-controller="MainCtrl"> | ||
<div class="container"> | ||
<h3>JSON pretty print with AngularJS <small>powered by <a href="https://github.com/pc035860/angular-highlightjs" target="_blank">angular-highlightjs</a></small></h3> | ||
<div class="row"> | ||
<div class="col-sm-6 col-12"> | ||
<h4 class="taller">JSON or Object expression</h4> | ||
<div> | ||
<textarea class="form-control" ng-model="editObject"></textarea> | ||
</div> | ||
</div> | ||
<div class="col-sm-6 col-12"> | ||
<h4> | ||
Pretty print | ||
<span class="text-muted">tab width: <input type="text" class="form-control" ng-model="tabWidth" maxlength="1" /></span> | ||
</h4> | ||
<div hljs source="toPrettyJSON(editObject, tabWidth)"></div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "with-browserify", | ||
"version": "0.0.0", | ||
"description": "", | ||
"main": "./scripts/app.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build": "browserify . -d -o scripts/bundle.js" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"angular": "^1.3.11", | ||
"angular-highlightjs": "^0.4.0", | ||
"browserify-shim": "^3.8.2" | ||
}, | ||
|
||
"browserify": { | ||
"transform": [ "browserify-shim" ] | ||
}, | ||
"browser": { | ||
"angular": "./node_modules/angular/angular.min.js" | ||
}, | ||
"browserify-shim": { | ||
"angular": "angular" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var angular = require('angular'); | ||
|
||
angular | ||
.module('exampleApp', [ | ||
require('angular-highlightjs') | ||
]) | ||
.controller('MainCtrl', require('./main-ctrl')); |
Oops, something went wrong.