angularjs - AngularStrap 2.x throw 404 Not Found when used with requirejs -
i'm trying use angular-strap requirejs in project , did following in requirejs.config.js file:
require.config({ baseurl: 'app', paths: { .......... angular: '../bower_components/angular/angular', 'angular-strap': '../bower_components/angular-strap/dist/angular-strap.min', 'angular-strap-tpl': '../bower_components/angular-strap/dist/angular-strap.tpl.min', .............. }, shim: { ........... angular: { deps: ['jquery'], exports: 'angular' }, bootstrap: { deps: ['jquery'] }, jquery: { exports: 'jquery' }, // simple dependency declaration 'jquery-ui': ['jquery'], 'jquery.flot': ['jquery'], 'jquery.flot.pie': ['jquery', 'jquery.flot'], 'jquery.flot.selection':['jquery', 'jquery.flot'], 'jquery.flot.stack': ['jquery', 'jquery.flot'], 'jquery.flot.stackpercent':['jquery', 'jquery.flot'], 'jquery.flot.time': ['jquery', 'jquery.flot'], 'angular-sanitize': ['angular'], 'angular-animate': ['angular'], 'angular-cookies': ['angular'], 'angular-dragdrop': ['jquery','jquery-ui','angular'], 'angular-loader': ['angular'], 'angular-mocks': ['angular'], 'angular-resource': ['angular'], 'angular-route': ['angular'], 'angular-touch': ['angular'], 'angular-strap': ['angular', 'angular-animate', 'bootstrap','timepicker', 'datepicker'], 'angular-strap-tpl': ['angular', 'angular-strap'], ....... } });
that's sample of file (i added dots removed details).
when tried start app, got following console logs:
get http://localhost:8983/project/tooltip/tooltip.tpl.html 404 (not found) angular.js:8521 http://localhost:8983/project/tooltip/tooltip.tpl.html 404 (not found) angular.js:8521 http://localhost:8983/project/tooltip/tooltip.tpl.html 404 (not found) angular.js:8521 ................................
i noticed angular-strap looks these files in baseurl, weren't found. how can make angular-strap search templates in correct file?
i found problem , injector can't find "angular-strap-tpl" path, when added app.js in require function worked.
sample code app.js
define([ 'angular', 'jquery', 'underscore', 'require', 'elasticjs', 'solrjs', 'bootstrap', 'angular-route', 'angular-sanitize', 'angular-animate', 'angular-strap', 'angular-strap-tpl', 'angular-dragdrop', 'extend-jquery' ]
and in manual bootstrapper of application added "mgcrea.ngstrap" dependency array this:
var apps_deps = [ 'elasticjs.service', 'solrjs.service', 'nganimate', 'mgcrea.ngstrap', 'ngroute', 'ngsanitize', 'ngdragdrop' ];
this solved problem , works now.
Comments
Post a Comment