AngularJS and Laravel Blade: Module Error when changing the interpolateProvider (Delimiter) -
i have strange problem when combining laravel 5 (with blade) , angular 1.3.
i experienced laravel, newbie angular. know have change angular's delimiters able make work laravel's blade.
so here did:
//app.js (function(){ var app = angular.module('teammanager', [], function($interpolateprovider) { $interpolateprovider.startsymbol('<%'); $interpolateprovider.endsymbol('%>'); }); app.controller('teamcontroller', function(){ // }); })();
an in view-file definded ng-app , ng-controller. goal iterate through json. json not part of js above - aware of that.
<div class="container" ng-app="teammanager"> <hr> <div class="row" ng-controller="teamcontroller team"> <div class="col-xs-4"> <div class="teamlist-container"> <table class="table table-striped"> <tr ng-repeat='member in teammembers'> <td><% member.firstname %> <% member.lastname %></td> </tr> </table> </div> </div> </div><!-- /row --> <hr>
if leave out $interpolateprovider code, work , no errors shown on console. - - nothings runs anymore. uncaught error: [$injector:modulerr]
when follow it, come to: error: $injector:unpr unknown provider
am missing something? tried code angularjs docs , tutorials. should fine. every time running in error , driving me crazy.
i me this, appreciate it.
many thanks, afx
i don't think injecting provider correctly, should in callback config method of app.
try:
var app = angular.module('teammanager', []); app.config(function($interpolateprovider) { $interpolateprovider.startsymbol('<%'); $interpolateprovider.endsymbol('%>'); });
update: in case of op, minifying process wasn't jiving angular syntax being used. asker need inject dependencies in following way use minify/uglify:
var app = angular.module('teamviewer', ['deps', function(deps) { //... }]);
and:
app.config(['$interpolateprovider', function($interpolateprovider) { //... }]);
this syntax minify , uglify safe.
Comments
Post a Comment