NgModel Issue



I figured a problem in this while working in latest 1.0.0-beta.1 and 1.0.0-beta.

Code looks like this

<input type="text" class="form-control" ng-model="xyz"> <button class="btn btn-success" ng-click="enter()"> Save </button> $scope.enter = function() { console.log($; }

@maxtherocket Can you look into this ?

This same piece of code works in 0.9 versions.


You are running into an issue with 2 way binding. This is generally because of the different child and isolate scopes used in Ionic.

You need to be using “dot notation”. Here is a great resource that will help you understand :

Here is a working example :


Thanks @Calendee for replying.
Actually I have also solved this similarly, but the example I gave actually worked in plain AngularJs App and and 0.9 version of ionic.

See this
So, why its not working in ionic latest version of 1.0 beta series.


Ionic may have added a new isolate scope to any one of the Ionic directives. I don’t know exactly which one. In any case, it really is best practice to use Objects instead of primitives.