Created
April 21, 2013 20:54
-
-
Save sunkay/5431044 to your computer and use it in GitHub Desktop.
main controller which provides the routes & models
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Global app module listing all its dependencies | |
var cotdServices = angular.module('cotd', ['DeviceModule']); | |
// setup mappings routes and templates | |
function cotdRouteConfig($routeProvider){ | |
$routeProvider. | |
when('/', { | |
controller: deviceListController, | |
templateUrl: 'listDevices.html' | |
}). | |
otherwise({ | |
redirectTo: '/' | |
}); | |
} | |
cotdServices.config(cotdRouteConfig); | |
// controllers | |
function deviceListController($scope, Devices) | |
{ | |
$scope.devices = Devices.query(); | |
$scope.remove = function(index){ | |
$scope.devices.splice(index, 1); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment