简体   繁体   中英

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? 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

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. See https://angular-ui.github.io/bootstrap/ for dependencies you will need. Then just add the required JS libraries to your index.html file, or webpack/gulp/grunt, whatever. Generally you want the vendor JS files to be include prior to your application JS files. They include a demo, if you want a reference: https://github.com/angular-ui/bootstrap/tree/master/misc/demo

Use 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> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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