E
E
ErickSkrauch2014-03-14 09:03:28
JavaScript
ErickSkrauch, 2014-03-14 09:03:28

How to do data binding in Angular.js?

There is already a ready-made project in which I am trying to implement Angular.js due to the fact that the site is fully Ajax-based and the template has a complex structure.

To load content, I use my library for jQuery, which hangs an on ('click') event on all links, and so on ...

But here's the problem - after applying the new content, Angular does not want to bind it in any way. On version 1.0.6, angular.bootstrap($('html'), 'ely') helps, but if you take it higher, then the re-initialization did not go through and an error pops up. If this is not done, then the new content will not be associated with Angular in any way (neither directives nor controllers).

What to do?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Sergey, 2014-03-14
Protko @Fesor

It seems to me that you should learn angular and reconsider your approach to integrating it. From what you described, you only need data-binding, and using angular only for this is stupid ....
ps why hang a handler on all links, if you can do this by delegating the handler to the entire document implement the directive.

R
Ruslan Lopatin, 2014-03-14
@lorus

docs.angularjs.org/api/ng/service/$compile

A
Alexander Khirenko, 2014-03-14
@Satanpit

How do you upload new content?

L
lega, 2014-03-15
@lega

If not very critical, then you can try Angular Light, it is more convenient for embedding into a finished application. See the 5th method of tying , it may suit you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question