javascript - Angular $uibModal causing Error: [$injector:unpr] -
i trying implement $uibmodal this site
but add $uibmodal service controller error: [$injector:unpr] http://errors.angularjs.org/1.4.8/$injector/unpr?p0=%24uibmodalprovider%20%3c-%20%24uibmodal%20%3c-%20dailymenucontroller angular code below:
var app = angular.module('app', ['djangular-confirm','djangular-alert','ui.bootstrap']).config(function($httpprovider,$interpolateprovider) { $httpprovider.defaults.headers.common['x-requested-with'] = 'xmlhttprequest'; $httpprovider.defaults.headers.common['x-csrftoken'] = '{$ csrf_value $}'; $interpolateprovider.startsymbol('{$'); $interpolateprovider.endsymbol('$}'); }); app.controller('dailymenucontroller', function($scope, $http, $location, $djconfirm, $djalert, $uibmodal ) { var modalinstance = $uibmodal.open({ }); });
i have added these 2 files: 'ui-bootstrap-custom-1.3.3.js' 'bootstrap-custom-tpls-1.3.3.js'
i novice in angular , did little development using angular far. searched on google , , came know "ui.bootstrap" while creating module. didn't resolve issue. great.
this kind of error [$injector:unpr]
states angular can't resolve provider item you're using - in case need inject $uibmodal
controller
app.controller('dailymenucontroller', ['$scope', '$uibmodal', function($scope, $uibmodal ) { var modalinstance = $uibmodal.open({ //... }); }]);
Comments
Post a Comment