angular-jsonld

0.2.0 • Public • Published

angular-jsonld Build Status

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

Dependents (0)

Package Sidebar

Install

npm i angular-jsonld

Weekly Downloads

0

Version

0.2.0

License

MIT

Last publish

Collaborators

  • boyum