javascript - how to display data from console angularjs -
i have controller retrieve data id state
. how can display console data in template?
app.controller('detailctrl', function($scope, $http, inventory, tags, user, $location, sharedservice, inventoryitem) { console.log(inventoryitem); };
here state
.state('inventory.description',{ url:'/inventory/description/:id', views: { "descriptionview": { templateurl: 'inventory/description.tpl.html', controller: 'detailctrl' } }, data:{ pagetitle: 'descriptionview'}, resolve: { inventoryitem: function($stateparams, inventory){ return inventory.query({id: $stateparams.id}); } } })
console retrieves data
resource {$promise: object, $resolved: false, $get: function, $save: function, $query: function…} $promise: object $resolved: true barcode: "11234" count: 22 cover: "/media/http%3a/api.bos.lv/media/static/images/no-image_1.png" created: "2014-03-07t11:07:18.184465" description: "lg monitor description" id: 2
you can think:
in controller can assign:
$scope.todisplay = inventoryitem;
and in template, add want display it:
{{todisplay.barcode}}
Comments
Post a Comment