Skip to main content

Posts

Showing posts with the label AngularJS

AngularJS

WIRING VIEWS   STEP 1 STEP 2 include ng-route.js STEP 3 create route.js angular.module('RouteModule',['ngRoute']) . config ([' $routeProvider ',function( $ routeProvider ){ $ routeProvider . when('/notes',{ templateUrl:'', controller : function($http){    var notes = this;   $http( {       method:'GET',       url: '/notes'    } ) . success ( function(data{         notes.data = data      } ) }, controllerAs: aliasname }) when('/noteworthy',{ controller : [ '$http','$routeParams',function($http, $routeParams ) {    var notes = this;    $http( {       method:'GET',       url: '/notes/'+ $routeParams.id    } ) . success ( function(data{         notes.data = data      } ) }, }) . when('/notes',{ }) . otherwise({ ...