javascript - AngularJS $resouce is adding $resolved and $promise -


I'm getting data using $ $ resource in AngularJS.

However, it is adding two additional properties to $ $ and $ in the result resolved. Below is my code. How can I get around this? MyStoreCheckoutService.factory ('checkout', function ($ resource) {return $ resource ('property / app / data / billing /: file.json', {}, {GetSalexTax: { Method: 'GET', params: {file: 'sales-tax'}, isArray: false}})}} myStoreCheckoutControllers.controller ('myStoreCheckoutCtrl', function ($ radius, checkout) {$ Scope.states = []; $ Scope.saleTaxMaster = Checkout.getSalexTax ({function () {console.log ($ scope.saleTaxMaster); getStates ();}); function getStates () {for $ scope.saleTaxMaster in var x} {if ( $ Scope.saleTaxMaster.hasOwnProperty (x)) {$ scope.states.push (x)}}}}}

Here my $ Scope.saleTaxMaster Both properties are

This is a $ resource Design / Feature If this is a problem, then you can skip properties starting with $, this is the same pattern in some angular functions such as angular.toJson (x) . Angel only keeps the promise and when you return the revised unit back to the server, $ is resolved by appearing. Another option is to use $ http, which does not return the object.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -