Ng-model doesn't work in different directive

For some reason I have to have a button in ion-footer, but my input is in ion-content, which they both are within 2 different directive. I have problem getting the value of ng-model. I have create a demo to show my problem :

I had once the same problem and I resolve it by making the variable in an object.
$scope.object = {
myInput : 123
Here the Solution :

1 Like

You have to understand the scoping in angular 1.

Directives create their own scopes.

the changed “myInput” in ionContent only lives there.