angularjs - ng Route with typescript -
i m getting error , ideas why ?
"uncaught error: [$injector:nomod] module 'route' not available! either misspelled module name or forgot load it. if registering module ensure specify dependencies second argument."
i dont understand really. reqister modules
module.requires.push("ngroute"); module.requires.push("route"); angular.module('route') // create new angular module .config(['$routeprovider', function ($routeprovider: angular.route.irouteprovider) { $routeprovider.otherwise('/'); $routeprovider .when('tlob', { templateurl: 'partial/layout.html' }) }]);
and @ top of page have
///<reference path="../../typings/tsd.d.ts"/> /// <reference path="../../typings/angularjs/angular-route.d.ts" />
your issue on line:
angular.module('route') // create new angular module
this not create module refer existing 1 name. if want create module here need supply array of other modules reference (even if empty). try this:
angular.module('route', []) // create new angular module
and take further since using ngroute
:
angular.module('route', ['ngroute']) // create new angular module
Comments
Post a Comment