是否NG-incude创建一个新的子范围有多大? [英] Does ng-incude creates a new child scope?

查看:122
本文介绍了是否NG-incude创建一个新的子范围有多大?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否NG-包括创建一个新的子范围有多大?

 < HTML和GT;
<机身NG-应用=mytodoApp>
< D​​IV CLASS =容器NG-包括='意见/ main.html中NG控制器=MainCtrl>< / DIV>
< / HTML>


解决方案

是的,从<一个href=\"https://docs.angularjs.org/api/ng/directive/ngInclude\">https://docs.angularjs.org/api/ng/directive/ngInclude:


  

该指令创建新的范围。


Does ng-include creates a new child scope ?

<html>
<body ng-app="mytodoApp">
<div class="container" ng-include="'views/main.html'" ng-controller="MainCtrl"></div>
</html>

解决方案

Yes, from https://docs.angularjs.org/api/ng/directive/ngInclude:

This directive creates new scope.

这篇关于是否NG-incude创建一个新的子范围有多大?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆