What is the purpose of $ state.includes in angularjs?

I'm new to angularjs, I'm a little confused between ng-include and $ state.includes . Can someone suggest me why we use $ state.includes instead of the ng-include directive?

+4
source share
2 answers

Imagine that you have a parent menu with some child menus. For each child menu, you have something like this to add an active class:

ui-sref-active="active"

, . ui-router.

<li ng-class="{ active: state.includes('parentState') }">

.. :

$scope.state = $state;

ng-include, $state.include. html .

+4

. Java JavaScript?: -)


, , !

+1

Source: https://habr.com/ru/post/1675235/