angular-jsonld
v0.2.0
Published
A directive for generating application/json+ld script tag
Downloads
2
Readme
angular-jsonld
A directive for generating application/json+ld script tag
Installation
$ npm install angular-jsonld
Add to your HTML (or build script or whatever). Remember to load it after angular itself.
<script type="text/javascript" src="./node_modules/angular/angular.min.js"></script>
<script type="text/javascript" src="./node_modules/angular-jsonld/angular-jsonld.min.js"></script>
Add to your app's dependency array
angular
.module('my-module', [
'sb-jsonld'
]);
Usage
my.controller.js:
angular
.module('my-module', ['sb-jsonld'])
.controller('MyController', function($scope) {
$scope.myJson = {
"test": "test
}
});
index.html:
<sb-jsonld json="{{myJson}}"></sb-jsonld>
Result:
<script type="application/ld+json">
{
"test": "test"
}
</script>
Build
To build the app, run npm run build
.
License
MIT Copyright 2016 Sindre Bøyum