Ionic creating childscope in

Hey there.
Refering this issue on git:

I am having trouble understanding why there should be another childscope created by

This creates problems such as I cannot access variables declared and filled via ng-model from my controller functions.

to clarify. this wont work:

<input ng-model="foo">

$scope.myfunc = function(){

someService.moo will be called with a null value since the controller can’t find the foo variable which is in the childscope created by ionic. doesn’t this defeat the whole angular 2 way data binding idea?

You’re using primitives - so 2 way binding is going to fail.

You should be using objects “dot notation”.

$ = { "foo" : "something-goes-here" }

thanks for clearing this up for me. I did create the variables i wanted to use in my views in my controller first most of the time which is why I never came across this error until now. Also if I didn’t do it then I probably never had a situation with a childScope which would have made me aware.

So I guess I better stick to my (personal?) practice of having an init function in my controller which is called when loaded and that instantiates all variables I later use in my view. This also helps me keep a good overview of all the variables I have.