Last active
August 29, 2015 13:56
-
-
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".
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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' | |
]); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great work