0

Hello, I am new to Angularjs. Below is my code :

.html file :

<!DOCTYPE html>
<html ng-app="showcase.angularWay.dataChange">
    <head>
        <script src='js/jquery-1.11.3.min.js'></script>
        <script src='http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js'></script>
        <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.7/angular-resource.min.js"></script>
        <script src='js/main.js'></script>
    </head>
    <body>
        <div ng-controller="AngularWayChangeDataCtrl as showCase">
            <input type='text' value="{{showCase.demo}}" />
            {{showCase.demo}}
        </div>
    </body>
</html>

.js file :

angular.module('showcase.angularWay.dataChange', ['ngResource'])
.controller('AngularWayChangeDataCtrl', AngularWayChangeDataCtrl);

function AngularWayChangeDataCtrl($scope) 
{
    var vm = this;
    vm.demo = "hello";
}

Output

When I enter any new text in input field then it doesn't update previously present text. (as shown in attached image).

1 Answer 1

0

You didn't provide model

Try like this

<input type='text' ng-model="showCase.demo" />

DEMO

Sign up to request clarification or add additional context in comments.

1 Comment

Yes you are right. Thank you very much for your help. I will accept the answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.