transpiling angularJs files in index.html -


my application comprises of 2 files.

//index.html <body ng-app="app" ng-controller="mycontroller">   hello {{ foo }}   <script src="app.js"> </body> 

javascript file:

 //app.js    (function() {     angular.module('app', [])      .controller('mycontroller', function($scope) {            $scope.foo = 'world!';      }     })(); 

what use es6 in app.js.

how include transpiled version in index.html ?

the simpliest way use babel directly transpile es6.js es5.js files.

for example, can add *.js files 'src' directory run :

babel src --out-dir dist 

and change html 'dist' directory. possible let babel concat js files one. the documentation

another possibility use created build gulp-angular. great bootstra project or understand how build works


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -