Sunday 15 February 2015

angularjs - how to pass data between 2 views with the same controller -



angularjs - how to pass data between 2 views with the same controller -

i working on mobile version site. have main view table of jobs. on desktop version share info between views , modals fine cant seem understand how share view view. both on same controller. need able populate sec view properties of object. plunkr

//pass info view 2 $scope.editjob = function () { $location.path('/editjob'); }; view 1 <table> <tr> <td ng-click="editjob(employee)">{{employee.address}}</td> </tr> </table>

view two

<input type="text" ng-model="favoritefood"/>

when alter app's location controller reloads, losing of it's state. so, can either set info want shared in service, or investigate alternate way of switching views (maybe ui-router or ng-include instance)

angularjs

No comments:

Post a Comment