This example shows a login form with email field being set as a string upfront. When click Login, it will do console.log
of that $scope.email
.
app.controller('MainCtrl', function($scope) {
$scope.email = 'test@test.com';
$scope.login = function() {
console.log($scope.email);
}
});
However, if I change the email field manually in the email input
and click login()
, it doesn’t update and print the new value.
If I removed ionic
out from this
var app = angular.module('plunker', ['ionic']);
The data binding works like a charm. So did ionic
module did something to angular binding?