Hi Surendra

ngRoute in not part of the 'main' angular library.  You therefore need to:

   - Include the library, for example:
   
<script src="//some/path/to/angular-route.js"></script>

   - Define a dependency on the library in *your code*, for example:

var myApp=angular.module("firstApp",["ngRoute"]);



Regards
Justin

On Thursday, 18 December 2014 12:12:53 UTC+2, surendra kumar wrote:
>
> //app.js
> var myApp=angular.module("firstApp",[]);
> myApp.config(function($routeProvider){
> $routeProvider.when('/',
>  {
> controller:"AppCtrl",
> templateUrl:"zippy.html"
>  })
>  });
> myApp.controller("AppCtrl",function($scope){
>
> $scope.model={
> message:"this is my app"
> }
>  });
>
>
> //main html page
> <body >
> <div  ng-app="firstApp">
> <ng-view></ng-view>
> </div>
> </body>
>
>
> //zippy.html
>
> <h1>{{model.message}}</h1>
>
>
>
> //console:
> app.js:1 Uncaught ReferenceError: $routeProvider is not defined
> angular.js:78 Uncaught Error: [$injector:modulerr] Failed to instantiate 
> module firstApp due to:
> Error: [$injector:nomod] Module 'firstApp' is not available! You either 
> misspelled the module name or forgot to load it. If registering a module 
> ensure that you specify the dependencies as the second argument.
> http://errors.angularjs.org/1.2.27/$injector/nomod?p0=firstApp
>     at 
> file:///C:/Users/manoj/Desktop/mytracker%20ui/3liunXtXrI/angular/js/angular.js:78:12
>     at 
> file:///C:/Users/manoj/Desktop/mytracker%20ui/3liunXtXrI/angular/js/angular.js:1677:17
>     at ensure 
> (file:///C:/Users/manoj/Desktop/mytracker%20ui/3liunXtXrI/angular/js/angular.js:1601:38)
>     at module 
> (file:///C:/Users/manoj/Desktop/mytracker%20ui/3liunXtXrI/angular/js/angular.js:1675:14)
>     at 
> file:///C:/Users/manoj/Desktop/mytracker%20ui/3liunXtXrI/angular/js/angular.js:3877:22
>     at forEach 
> (file:///C:/Users/manoj/Desktop/mytracker%20ui/3liunXtXrI/angular/js/angular.js:325:18)
>     at loadModules 
> (file:///C:/Users/manoj/Desktop/mytracker%20ui/3liunXtXrI/angular/js/angular.js:3871:5)
>     at createInjector 
> (file:///C:/Users/manoj/Desktop/mytracker%20ui/3liunXtXrI/angular/js/angular.js:3811:11)
>     at doBootstrap 
> (file:///C:/Users/manoj/Desktop/mytracker%20ui/3liunXtXrI/angular/js/angular.js:1444:20)
>     at bootstrap 
> (file:///C:/Users/manoj/Desktop/mytracker%20ui/3liunXtXrI/angular/js/angular.js:1459:12)
> http://errors.angularjs.org/1.2.27/$injector/modulerr?p0=firstApp&p1=Error%
> …op%2Fmytracker%2520ui%2F3liunXtXrI%2Fangular%2Fjs%2Fangular.js%3A1459%3A12)
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to