简体   繁体   English

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

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

Is there a way that I could reference UI-Bootstrap to an AngularJS Project without using any Package Manager or alike program? 有没有一种方法可以在不使用任何程序包管理器或类似程序的情况下将UI-Bootstrap引用到AngularJS项目? I tried to make a deep search for it but failed to find one. 我试图对其进行深入搜索,但没有找到。

I tried to download the UI-Bootstrap package from its home site but it somehow needs NPM to be able to add it on a project 我尝试从其主页下载UI-Bootstrap程序包,但它某种程度上需要NPM才能将其添加到项目中

There is no reason you have to use NPM or any other package manager/build-tool, as long as you are willing to manage the dependencies your self. 只要您愿意自行管理依赖项,就没有必要使用NPM或任何其他程序包管理器/构建工具。 See https://angular-ui.github.io/bootstrap/ for dependencies you will need. 请参阅https://angular-ui.github.io/bootstrap/了解所需的依赖关系。 Then just add the required JS libraries to your index.html file, or webpack/gulp/grunt, whatever. 然后只需将所需的JS库添加到index.html文件或webpack / gulp / grunt中即可。 Generally you want the vendor JS files to be include prior to your application JS files. 通常,您希望将供应商JS文件包含在应用程序JS文件之前。 They include a demo, if you want a reference: https://github.com/angular-ui/bootstrap/tree/master/misc/demo 如果您需要参考,它们还包括一个演示: https : //github.com/angular-ui/bootstrap/tree/master/misc/demo

Use https://unpkg.com/browse/angular-ui-bootstrap/dist/ 使用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