栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

您可以覆盖AngularUI Bootstrap中的特定模板吗?

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

您可以覆盖AngularUI Bootstrap中的特定模板吗?

是的,来自http://angular-ui.github.io/bootstrap的指令是高度可定制的,并且很容易覆盖其中一个模板(其他模板仍然依赖默认模板)。

只需

$templateCache
通过直接喂食(如在
ui-bootstrap-tpls
文件中完成)或(可能更简单)使用
<script>
指令(doc)覆盖模板,就可以喂食。

在那里我改变了警报的模板来交换一个人为的例子

x
Close
如下所示:

<!doctype html><html ng-app="plunker">  <head>    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js"></script>    <script src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.4.0.js"></script>    <script src="example.js"></script>    <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">    <script id="template/alert/alert.html" type="text/ng-template">      <div  ng->          <button ng-show='closeable' type='button'  ng-click='close()'>Close</button>          <div ng-transclude></div>      </div>    </script>  </head>  <body>    <div ng-controller="alertDemoCtrl">      <alert ng-repeat="alert in alerts" type="alert.type" close="closealert($index)">       {{alert.msg}}      </alert>      <button  ng-click="addalert()">Add alert</button>    </div>  </body></html>

现场演奏者:http
://plnkr.co/edit/gyjVMBxa3fToYTFJtnij?p=preview



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/668731.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号