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 :


Popular posts from this blog

c# Service Play Sound with NAudio example by Moshe

Asp.Net Ending Response options, Response.End() vs CompleteRequest()

JS/JQ simulate Enter event