javascript - Angularjs: issue with array assignment -


im facing a heterodyne issue, I've defined an object (for applications globally) In which array object is visible

  var _global = {document: {}, // represents the selected item};  

And in my service I have something like this

  _global.document.signers = [{name: 'test', email: 'test @ test .com '}];  

Its work is fine now if I

  _global.document.signers.push ({name: 'test', email: 'test @ test. Com '});  

And in the controller I use

  var signers = _global.document.signers;  

This works fine

  _global.document.signers = [[{name: 'newtest', email: 'newteest @ test') < / P> 

.com '}];

The global object is updated, but the view does not present new values ​​and if I change it then it starts to present new values ​​

Wrong. Any help would be appreciated

updated

thanks for the help @shani I have solved it using

 < Code> var drafts = globalService.getGlobal (); // global service $ scope.draft = draft to maintain global goods;  

and in the view

  & lt; Ul class = "list-volatile font-11px" & gt; & Lt; Li ng-repeat = "(signerIndex, signatory) draft.document.signers" & gt; & Lt; / Li & gt; & Lt; / Ul & gt;  

Assign your global object to your controller area, because the services are unity if If there is a change in service objects, your administrator will automatically respond to it.


Comments