javascript - Asynchronously update EmberJS Fixture Adapter -


i have table of links i'm trying pull external json file. simple html , handlebars:

<table class="table">   <thead>     <tr><th>links</th></tr>   </thead>   {{#each model}}   <tr><td>     <a target="_blank" {{bindattr href="url"}}>{{title}}</a>   </td></tr>   {{/each}} </table> 

and app.js, i'm trying load json asynchronously fixture adapter:

var externallinksjson = [{     id: 0 }];  $.getjson('externallinks.json', function(data) {     externallinksjson = data; }) .fail(function() { console.error("there error loading externallinks.json"); });  app.externallink.fixtures = externallinksjson; 

debugging javascript shows externallinksjson variable getting updated successfully, emberjs isn't updating html newly fetch json. i'm trying avoid blocking browser synchronous calls. there way in emberjs bind fixtures updates when values change?

i under impression fixtures adapter static testing data defined in client's javascript, concern whether designed update after app js has loaded.. have tried putting fixture data clientside see whether problem?

from ember site:

fixtures way put sample data application before connecting application long-term persistence.

perhaps try using rest adapter of ember data, or dealing api calls without ember data.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -