código para capturar el evento del ui-router
This commit is contained in:
parent
017c0caf7e
commit
c85863b5c4
|
@ -8,18 +8,21 @@ export const COMPONENT = {
|
|||
bindings: {
|
||||
client: '<'
|
||||
},
|
||||
controller: function($http, $rootScope, copyObject, equalsObject) {
|
||||
controller: function($http, $rootScope, copyObject, equalsObject, $state) {
|
||||
|
||||
this.currentstate = $state.current;
|
||||
var self = this;
|
||||
|
||||
this.$onChanges = function (changes) {
|
||||
if(this.client)
|
||||
this.clientOld = copyObject(this.client);
|
||||
}
|
||||
|
||||
/*$rootScope.$on("$locationChangeStart", function(event) {
|
||||
if(!equalsObject(this.client, this.clientOld)){
|
||||
$rootScope.$on("$stateChangeStart", function(event, next) {
|
||||
//if(!equalsObject(self.client, self.clientOld)){
|
||||
event.preventDefault();
|
||||
}
|
||||
});*/
|
||||
//}
|
||||
});
|
||||
|
||||
$http.get('/client/api/SalesPeople').then(
|
||||
json => this.sales = json.data,
|
||||
|
@ -37,5 +40,5 @@ export const COMPONENT = {
|
|||
};
|
||||
}
|
||||
};
|
||||
COMPONENT.controller.$inject = ['$http', '$rootScope', 'copyObject', 'equalsObject'];
|
||||
COMPONENT.controller.$inject = ['$http', '$rootScope', 'copyObject', 'equalsObject', '$state'];
|
||||
module.component(NAME, COMPONENT);
|
||||
|
|
Loading…
Reference in New Issue