Created
April 25, 2013 02:53
-
-
Save sunkay/5457190 to your computer and use it in GitHub Desktop.
Angularjs forms controllers, using a shared service & using $location to redirect to our desired path
This file contains hidden or 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
| function addDeviceController($scope, $location, Devices) | |
| { | |
| //console.log("add-Field" + $scope.device.name); | |
| $scope.add = function(device){ | |
| device['id'] = (Devices.query().length)+1; | |
| Devices.add(device); | |
| console.log(device); | |
| // redirect to main screen | |
| $location.path('#/'); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment