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
Post a Comment