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

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -