0

I have placed a simple fiddle here:

http://jsfiddle.net/77vXu/

var myApp = angular.module('myApp', []);

myApp.controller('test', function($scope) {
    $scope.cancelMessage = '';
    $scope.clickTest = function(){
        alert($scope.cancelMessage);
    };
};

and have tried to follow the basic tutorial as closely as possible. However, I can't get any of the variables to bind. What am I doing wrong?

2 Answers 2

3

The end brackets for your controller needs to be this:

});

instead of this:

};

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

Comments

1

I've update your fiddle to load Angular in the body and closed the controller as mentioned by user621545.

var myApp = angular.module('myApp', []);

myApp.controller('test', function($scope) {
    $scope.cancelMessage = '';
    $scope.clickTest = function(){
        alert($scope.cancelMessage);
    }; 
});

Comments

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.