Powered by Blogger.

How to pass parameter in routeparam

var app = angular.module( "Demo", [ "ngRoute" ] );

app.config(
   function( $routeProvider ) {
   // Define routes for the application.$routeProvider
         .when(/calendar/:month/:day/:year,{
             templateUrl:'calendar.html", 
             controller:'CalendarCtrl"
         })
  }); 
 
Now Controller
app.controller("CalendarCtrl",function($scope,$routeParams)
{
    $scope.model = {
        message: "date : +$routeParams.month    }
});

   
hit the url:- http://localhost:8090/#/calendar/12/26/2015

0 comments:

Recent Articles

© 2014 Learning Java. WP themonic converted by Bloggertheme9. Published By Gooyaabi Templates
TOP