I apologize in advance if i’m not wording this properly. I have a textbox with ng-model inside an ng-repeat and when I try to get the textbox value it’s always undefined. I just want it to display whatever I type in the corresponding textbox.
It seems to be an issue with the $scope, so how would I make the $scope.postText global or at the controller root level so it can be accessible?
Here’s the JSFiddle to help clear things up: http://jsfiddle.net/stevenng/9mx9B/14/
In your click expression you can reference the
postTextand access it in yoursavePostfunction. If this wasn’t in an ng-repeat you could access the single$scope.postTextsuccessfully but ng-repeat creates a new scope for each item.Here is an updated fiddle.