javascript - Angular Data updating -


Good afternoon I am developing a project with angular JS and I have a list of the page on which the update GPS Smartphone coordinates gets

I am when I am always on the same page, everything works fine and the page is updated with the correct objects

But when I turned on a separate page Go back to the page with the list then the data is updated in the model (checked with console - log -> array has items) but then the list is still empty when you view the web page

HTML page (list) from snippet

  & lt; Label class = "item item-radio" ng-repeat = "projects projects lateness" & gt; & Lt; Input type = "radio" name = "project" ng-model = "info.currentProject" ng-value = "project.id" & gt; & Lt; Div class = "item-content" & gt; {{Project.name}} - {{project.customer}} & lt; / Div & gt; & Lt; I class = "radio-icon ion-check mark" & gt; & Lt; / I & gt; & Lt; / Labels & gt;  

The methods in the controller that adjust the data for the list are called (these methods are made controller and GPS coordinates change when called)

  $ Scope.clearCurrentProjectsAtLocations = function () {console.log ("Current Projects Approval"); While ($ scope.projectsAtLocation.length & gt; 0) {$ scope.projects location location pop (); } //$scope.projectsAtLocation = null; }; $ Scope.updateCurrentProjects = function (Location ID, callback) {//$scope.projectAtLocation = []; ProjectLocationDbService.getAllByLocationId (locationId, // success function (Tx, results) {// success if (results.rows.length! = 0) {// Update the list of projects on track // current location TrackingService on a project SetProjectsAtLocation ( For results.rows); (var i = 0; i & lt; results.rows.length; i ++) {$ scope.projectsAtLocation.push (results.rows.item (i))}} // If we Only project 1 current location ==> Automatically start tracking on it if (results.rows.length == 1) {$ scope.info.currentProject = results.rows.item (0) .id;} $ Radius. $ Apply ();} callback ();}, // error Maroh () {}); };  

I think the code is fairly self-explanatory, but if you would like to try to answer me raises a question about the ill-code

and I would appreciate any feedback to help solve this problem

Regards, Bawo


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -