How to integrated riot.js with Angular 9

141 Views Asked by At

I am working on a project with Angular Framework and I need to integrate another project written in Riot.js.
And this is really hard for me.
I hope to receive help from everyone.
Thanks

2

There are 2 best solutions below

0
exside On BEST ANSWER

Have a look at https://github.com/lucasbrigida/angular-riot, it allows you to render with riot inside an Angular app, something like this:

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' }
          ]
        });
      });
}]);
0
bik On

the simplest solution is to use Iframe otherwise maybe you could use the angular project as angular elements and monorepos