<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js">
</script>
<body>
<p>Change the value of the input field:</p>
<div ng-app="" ng-init="myCol=''">
<input style="background-color:{{myCol}}" ng-model="myCol">
</div>
<div id="secondApp" ng-init="myCo=''">
<input style="background-color:{{myCo}}" ng-model="myCo">
</div>
<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>
<script type="text/javascript">
var secondDiv = document.getElementById('secondApp');
angular.element(document).ready(function() {
angular.bootstrap(secondDiv, [ 'secondApp' ]);
});
</script>
</body>
</html>
Here is my code. The first input field works perfectly but the second input field is not working even I use bootstrap. Please anyone show me the right way to do it. Thanks