caching - angularjs data binding with cache factory not working -


Take a look at this (data binding name is being in list but not in movie list)

Click on a name on the list of names: Details are shown below: If you edit the data in the description, the list is updated with data binding (as expected)

Do the same with the list, click on a movie, and edit the data in the details below. The list is not updated

The only difference in 2 factories is that "name" is from a static JSN file and "movies" from the movie API.

This is my factory of movies:

  app.factory ('moviesFactory', function ($ http) {var cached Data; function getData (callback) {if ( Cached data {callback (cache data);} and {$ http.get ('https://yts.re/api/list', {params: {quality: "3D", range: 3}}). (Get data, callback) {getData (function) {var movie = Data.filter (return entry) movie id === item id;}) [0]; callback (movie);});}};});  

The only difference in the name factory is:

  $ http.get ('foo.json'). Success (work (data) {...}  

I do not know why the name list works and movies are not.

I have data-tied films How can I list movies? Any thoughts?

Back to the cached data Return, you will get updated data (cached data) {callback (cached data);} and {$ http.get} (android) ('http: //yts.re/api/list', {params: {quality: "3D", range: 3}}) Success (work) {cached Data = data.MovieList; callba Ck (cached data);}}} return {getAll: getData, getOne: function (item ID, callback) {getData (function (data) {var movie = data.filter (function (entry) {return entry} MovieID = == itemId;}) [0]; callback (movie);});}};});


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -