Hi all,

I've built a application with AngularJs and NodeJs, view template EJS. 
When I render a page, I set value of input (ng-model) and I want to get 
that model in controller but I can't get it. 
This is my file EJS:

<!DOCTYPE html>
<html ng-app='test'>
    <head>
        <script src="/angular/angular.js"></script>
        <link rel='stylesheet' href='/stylesheets/style.css' />
    </head>
    <body ng-controller='testCtrl'>
        <input type="text" ng-model='testModel' ng-change='change()' 
ng-init="testModel ='John'">
    </body>
</html>

<script>
    var testApp = angular.module('test', []);

    testApp.controller('testCtrl', function($scope){
        $scope.change = function(){
            console.log($scope.testModel);
        };
        console.log($scope.testModel);
    });
</script>

Anyone can help me please?
Thanks and Best Regards,

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to