angularjs - Why do we have to initialize ng-model in controller -
i new angular realized in order use ng-model should initialize in controller. example, in index.html have:
<input type="text" name="source" ng-model="source">
if don't initialize in controller, won't work.
$scope.source = '';
can explain why?
Comments
Post a Comment