I am creating a small web framework using AngularJS, Bootstrap and Jquery. I will be adding several reusable angular directives in this framework. This framework will be used by several other web applications. This is the structure
WebApp1
|-js
| |_testFramework.js
| |_lib
| | |_angular.min.js
| | |_bootstrap.min.js
| | |_jquery.min.js
| |_main.js
| |_require.js
| |_controllers.js
|_index.html
my testFramework.js looks like this
require.config({
paths: {
jquery: 'lib/jquery.min',
angular:'lib/angular.min',
bootstrap:'lib/bootstrap.min',
},
shim: {
'angular' : {exports:'angular'},
}
});
define(['angular'],function(angular){
console.log('framework loaded');
var fw = angular.module("framework",[]);
ff.directive("dir1",function(){
}.directive("dir2",function(){
}
}
My Main.js is as below
require.config({
paths: {
fw: 'framework',
controllers: 'controllers'
}
});
define(['fw','angular'],
function(fw, angular){
var app = angular.module("myWebApp1",['fw']);
$routeProvider.when('/login',{templateUrl:'partials/login.html'});
$routeProvider.otherwise({redirectTo: '/login'});
}])
console.log('app loaded');
}
);
Index.html has
<script data-main="js/main.js" src="js/require.js"></script>
But I always get this below error when I try to load the app
"NetworkError: 404 Not Found - https://localhost:8000/WebApp1/js/angular.js"
Why is it trying to load angular from /js, instead of what is mentioned in the testFramework.js