jueves, 18 de diciembre de 2014

Funciones

<option ng-repeat="e in obras | filter:comprobarRegistroExistente track by e._id" value="{{e._id}}">{{e.nombre}}</span></option>

$scope.comprobarRegistroExistente = function(obra){
return $scope.proyectoSeleccionado && $scope.proyectoSeleccionado.obras && $scope.proyectoSeleccionado.obras.indexOf(obra._id) == -1;
};

//Enviar variables de scope a scope
//Enviar variables
$scope.secondCtrl = function(){
$rootScope.$emit('someEvent', 1)
$location.url('/poa')
}

//Leer variables
$rootScope.$on('someEvent', function(event, data) {
$scope.prueba = data
});

No hay comentarios:

Publicar un comentario