Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function AgendaCtrl($scope){
- $scope.lista = [];
- $scope.item = {};
- $scope.salvar = function(){
- if(!$scope.item.id){
- $scope.item.id = new Date().getTime();
- $scope.lista.unshift($scope.item);
- }
- $scope.item = {};
- };
- $scope.editar = function(i){
- $scope.item = $scope.lista[i];
- };
- $scope.excluir = function(i){
- $scope.lista.splice(i,1);
- $scope.item = {};
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement