Skip to content

Instantly share code, notes, and snippets.

@danielkhan
Last active August 29, 2015 13:56
Show Gist options
  • Save danielkhan/9134193 to your computer and use it in GitHub Desktop.
Save danielkhan/9134193 to your computer and use it in GitHub Desktop.
This refers to the tutorial at: http://www.startersquad.com/blog/angularjs-requirejs/ and the problems getting the routingProvider $routeProvider working which results in "Unknown provider: $routeProvider".
// 1. you may need to download angular-routes separately - I got it along with the angular webjar
// 2. add path and shim config
// require config
requirejs.config({
shim: {
"app": ["angular"],
"angular-route": ["angular"] // !!!
},
paths: {
"domReady": webjars.path("requirejs-domready", "domReady"),
"angular-route": YOUR_PATH // !!!
},
deps: ['./ng-bootstrap']
});
// 3. require angular-routes in app.js
define([
'angular',
'angular-route', // !!!
'./app/controllers',
'./app/directives',
'./app/filters',
'./app/services'
], function (ng) {
'use strict';
return ng.module('app', [
'ngRoute', // !!!
'app.services',
'app.controllers',
'app.filters',
'app.directives'
]);
});
@blackland1954
Copy link

Great work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment