T
T
topdetal2016-01-13 16:44:07
JavaScript
topdetal, 2016-01-13 16:44:07

How to make scripts work in code that is connected via ng-include?

There is an index.html file, which has structural blocks such as sliders, carousels (code processed by scripts). All scripts are included in it.
I remove all content from index and instead write ng-view in which I output a file in which all content blocks are connected using

<div>
    <ng-include src="'partial/slider.html'" />
</div>

And when the code is connected via ng-include, the scripts do not work. Although all files are included, there are no errors in the console.
What could be the problem?
Help me please!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kostya Gorozhanov, 2016-01-13
@kgorozhanov

Script files cannot be included via ng-include.
In the loaded code fragment, you can specify the controller that is responsible for it using ng-controller, you connect the controller initially.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question