max_mara2013-07-01 20:48:30
max_mara, 2013-07-01 20:48:30

Angular doesn't see the binding


I'm slowly learning with Angularjs, I want to make a simple email subscription form.

Here is an example http://jsfiddle.net/2Kaju/

But for some reason $scope does not have my email variable.

Where am I wrong? And in general, maybe I'm not doing this form correctly at all?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
EugeneOZ, 2013-07-01

Variables are in different $scope.
Use "dot" in such cases: jsfiddle.net/2Kaju/8/
More: www.egghead.io/video/DTx23w4z6Kc

egorinsk, 2013-07-02

You have chosen the wrong tool for this task and the wrong example for learning the framework. In this case, the best tool is code like $(form).submit($.ajax({})). Connecting a monstrous framework for the sake of 2 fields is at least strange.
Angular is designed primarily for creating CRUD applications (this is written in the documentation). Applications with models, navigation, ajax and more. The fact that you are trying to make a subscription form for them says that either 1) you did not even read the first chapter of the documentation 2) you read, but did not understand what is written there.
And I hope that you are doing this for yourself, and not for a customer or employer, for example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question