AgnularJS ng-model directive usage

Why in the following AngularJS example ng-model directive is used? It works without this directive – as one can test it by removing the ng-model directive and setting myCol variable to any valid background color value. What is the use of ng-model directive here?

<!DOCTYPE html>
<script src=""></script>

<p>Change the value of the input field:</p>

<div ng-app="" ng-init="myCol='lightblue'">

<input style="background-color:{{myCol}}" ng-model="myCol">


<p>AngularJS resolves the expression and returns the result.</p>

<p>The background color of the input box will be whatever you write in the input field.</p>



ng-model provides two-way binding, so although ng-init sets the initial value, if you want to be able to dynamically respond to user input (changing the colour via the input) then you need ng-model.