Bresleveloper's AngularJS Tutorial : Basic+ Route / Routing

there is a nice thing with the $routeProvider that I learned from maybe the best and most advanced blogger in the world about angular - Ben Nadel, here in this post :
u can put anything u want in ur routes!

Ex no. 11

view (customRouteView, only for that top div) - I added this div at the top:
<div>{{ Bresleveloper }}</div>

code (Ex 11) - there r only 2 changes, 1st I added a view with the extra div
templateUrl: 'Views/customRouteView.html'

2nd change is in the CTRL:
var myController = function ($scope, myService, $route) {
    console.log("myController - NEW INSTANCE");
    $scope.myService = myService;

if ($route.current.Bresleveloper) {
        $scope.Bresleveloper = $route.current.Bresleveloper;
else {
        $scope.Bresleveloper = ":)";

another example, to help understand Bens example is my Ex 19

now if u think its of no use, then Ben took it to the next level here :
I do advice you to make a couple of angular apps before trying that cuz its a bit hard to grasp, u use routing but not for routing, look at my examples Ex 19.

Next :


  1. AngularJS is a toolset for building the framework most suited to your application development. It is fully extensible and works well with other libraries. Every feature can be modified or replaced to suit your unique development workflow and feature needs. Read on to find out how.

    AngularJS Training in Chennai


Post a Comment

Popular posts from this blog

c# Service Play Sound with NAudio example by Moshe

JS/JQ simulate Enter event

SOLVED The item could not be indexed successfully because the item failed in the indexing subsystem