Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Access to dynamic/programtically created $scope variables

$
0
0

@IThompson wrote:

I have generated dynamic content in an <ion-content> using a javascript controller. This controller essentially creates a number of <input type="text" ng-model="pagedata.name?"> and a button that is used to process the data entered. Where 'pagedata.name?' varies depending on the form being generated. I build this up by basically creating the html, the $sce.trustAsHtml(html), and the $compile directive. All good at this point, the button works and the page works as if I had hard-coded it in the html template.

BUT, when the button is pressed and I want to process the content of the form I cannot dynamically access the $scope variables created. I can access them with hardcoded javascript as in $scope.pagadata.name1, $scope.pagedata.name2 etc but I need to be more dynamic such as $scope['pagedata.name1'] for example (I have the name of the ng-model used). Is there a way that I can dynamically get the $scope variables that I dynamically create?

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>