You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Works by using the Model.getCache() method to get the data synchronously from the local cache. If said cache value is undefined, it makes a request with a safeApply($rootScope) on the observable, which then causes the filter to be rerun.
Rather than calling the filter async, I called it getValue (prefixed as rol_getValue) since it's specific to calling Model.getValue(), rather than being generic to all observables.
The problem with the generic observable solution is that each time the $digest loop runs, you have a new observable object to deal with. So you can't even create a mapping to substitute the correct value later.
Also created a pageRange (rol_pageRange) filter to help when dealing with a range of objects.
For example: You know there's a todos array in the JSON graph, but you can't retrieve the whole thing from FalcorJS. But you can retrieve it's length. And since length could be a huge value, you select a range of indexes from 0 to length - 1.
ng-repeat="index in 'todos.length' | rol_getValue:model | rol_pageRange:currentPage:pageSize"
To take this example up to 11, going to need something equivalent to the 'async' pipe from the Angular 2 examples.
The common solution is to use a stateful filter:
http://stackoverflow.com/questions/19046641/asynchronously-initialize-angularjs-filter
The text was updated successfully, but these errors were encountered: