Angular does not see the binding


Slowly versed with Angularjs, I want to make a simple form to subscribe to the email newsletter.

Here is an example

But for some reason the $scope variable is not my email

Where am I wrong? And in General I can is not correct this form do?
October 3rd 19 at 04:36
2 answers
October 3rd 19 at 04:38
The variables are in different $scope.
Use "point" in such cases:
Read more:
You are right, thank you.

And this is a bug or a feature? What is the reason? - Eldred.Reynolds commented on October 3rd 19 at 04:41
Feature, made for the separation of scopes. Helps when using ng-view, but sometimes interfere. - fleta.McLaughl commented on October 3rd 19 at 04:44
better not to tie binding forms using nested $scope properties if you are using ng-submit. so you will have strong communication presentation and logic. in the method of the submit you have your own scope you can get for reference
for one you need to read the official documentation - corali commented on October 3rd 19 at 04:47
October 3rd 19 at 04:40
You chose the wrong tool for this task and wrong case study framework. In this case the best tool is a code like $(form).submit($.ajax({})). To connect monstrous framework for 2 courses, at least strange.

Angular is designed primarily to create a CRUD application (it's written in the documentation). Applications with models, navigation, Ajax, and other. What you are trying to make the subscription form says that either 1) you didn't read even the first Chapter of the documentation 2) predicted, but did not understand what is written there.

And I hope you do it for yourself, not for the customer or employer, for example.
Instead of "monster" AngularJS You offer "miniatyurnenkaya" jQuery?
angular.min.js — 79 Kb
jquery.min.js — 91 Kb.

And the rest is too wide.
View - Eldred.Reynolds commented on October 3rd 19 at 04:43
I can not agree. Angular provides features such as modules, services, DI, bidirectional binding. None of these possibilities is not required in order to read the email from the form, scan it to send to the server Ajax and display the message.

Where you have a bidirectional binding where models where directives where dependency injection, where the unit tests where services and modules, where dependencies where the templates?

To use here angular is all the same what to hammer in nails a microscope, in principle this is possible, but it looks strange and a question, and whether the person understands what he's doing. If you want to learn a framework, so take the normal problem where it was.

If jQuery is too big, you can take something like Zepto JS or Vanilla JS, this fact does not change, where necessary wrapper around the DOM, it is logical to use a wrapper around the DOM, and not something else.

> View

Well, look, there's just somewhere 50 on 50: half — apps with forms and models, and half left-wing sites where people just decided to use Angular, because it is fashionable, though it nafig not needed. - fleta.McLaughl commented on October 3rd 19 at 04:46
Yes jQuery is also not one function provides — they have to use? Ajax requests it's not a wrapper over DOM. All you can and native JS to do this. Man just looking at Angular, and You just talk trash and Troll. - corali commented on October 3rd 19 at 04:49
If he studies framework, it needs to understand what it is and where it is appropriate to use and not try to use it everywhere just because it is every day, write on habré. I'm trying to help him and to explain it. Where is the trolling? - fleta.McLaughl commented on October 3rd 19 at 04:52
You can use it anywhere. In the example of the author of the question is not only sending a request and code in jQuery would be more. Similarly, I could cite a couple of lines in pure js with sending the request.
This framework is intended not only for CRUD applications do not prevent people from studying one of the best tools of our time. - marcus.Champlin53 commented on October 3rd 19 at 04:55
I'm learning Angular by example.

Ah, if only the mold send! © Lazy - fleta.McLaughl commented on October 3rd 19 at 04:58

Find more questions by tags AngularJavaScript