How to integrate a library written in riot.js into angular app

40 Views Asked by At

Can I get any example of library written in riot.js is being used in angular app?

1

There are 1 best solutions below

0
exside On

You can use this ready made angular module https://github.com/lucasbrigida/angular-riot and then do the following:

angular.module('moduleName', ['angular-riot'])
  .controller('ctrlName', ['$scope', $document, 'riot', function ($scope, $document, riot) {
      $document.ready(function () { 
        riot.mount('todo', {
          title: 'I want to behave!',
          items: [
            { title: 'Avoid excessive coffeine', done: true },
            { title: 'Hidden item', hidden: true },
            { title: 'Be less provocative' },
            { title: 'Be nice to people' }
          ]
        });
      });
}]);