繁体   English   中英

将UI-Bootstrap引用到AngularJS项目的另一种方法

[英]Alternative way to reference UI-Bootstrap to AngularJS Project

有没有一种方法可以在不使用任何程序包管理器或类似程序的情况下将UI-Bootstrap引用到AngularJS项目? 我试图对其进行深入搜索,但没有找到。

我尝试从其主页下载UI-Bootstrap程序包,但它某种程度上需要NPM才能将其添加到项目中

只要您愿意自行管理依赖项,就没有必要使用NPM或任何其他程序包管理器/构建工具。 请参阅https://angular-ui.github.io/bootstrap/了解所需的依赖关系。 然后只需将所需的JS库添加到index.html文件或webpack / gulp / grunt中即可。 通常,您希望将供应商JS文件包含在应用程序JS文件之前。 如果您需要参考,它们还包括一个演示: https : //github.com/angular-ui/bootstrap/tree/master/misc/demo

使用https://unpkg.com/browse/angular-ui-bootstrap/dist/

 angular.module('ui.bootstrap.module', ['ui.bootstrap']) .controller('ui.bootstrap.ctrl', function ($scope) { $scope.ToolTipText = "Hello, World!"; }) 
 <link href="//unpkg.com/bootstrap@3/dist/css/bootstrap.css" rel="stylesheet"> <script src="//unpkg.com/angular/angular.js"></script> <script src="//unpkg.com/angular-ui-bootstrap/dist/ui-bootstrap-tpls.js"></script> <div ng-app="ui.bootstrap.module" > <div ng-controller="ui.bootstrap.ctrl"> <span uib-tooltip="{{ToolTipText}}" tooltip-placement="bottom" > Hover for Tooltip </span> </div> </div> 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM