I
I
Ilya2015-01-29 00:36:36
Angular
Ilya, 2015-01-29 00:36:36

How to call a method from a template in Angularjs?

How to call a method from a template from a controller in angularjs? However, this method must be called itself when the page is loaded. Thank you.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
_
_ _, 2015-01-29
@AMar4enko

I dare to suggest that you are trying to go the wrong way.
Describe the task itself.

A
Aleksei Podgaev, 2015-01-29
@alexiusp

The question is worded very vaguely. I don't quite understand what is required either.
Turn on telepathy. You want the template to have some function name that will run when this template is loaded, right?
Do you want to run the function when the page finishes loading, or when the template finishes loading, or is it irrelevant? I would like specifics, tk. I see several solutions.

D
Dmitry Dedukhin, 2015-01-29
@Demetros

For example
But as mentioned above, you probably want to do something wrong.
If you are using ui-router, then you can execute code on the $stateChangeSuccess event

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question