ionic framework - Data not updating in AngularJS -


i working on web app in ionic. here, have button in menu.html, when clicked should cause function in controllers.js add newdata "data" in appapi.js file getting error. can take look? here's code in menu.html , controllers.html: http://pastebin.com/gw0h2g3p , here appapi.js: http://pastebin.com/jbqqubcp

thanks!

in appapi service

var adddata = function(newdata) {     data[data.length] = newdata; }  return {     getdata: getdata }; 

adddata private. it's not exposed.

in controller: trying access adddata not available.

 $scope.add = function() {         appapi.adddata($scope.newdata);     } 

to fix it: add adddata return object in service

var adddata = function(newdata) { data[data.length] = newdata; }

return {     getdata: getdata,     adddata  : adddata }; 

Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -