当前位置: 首页 > 软件库 > Web应用开发 > Web框架 >

ngx-bootstrap

授权协议 MIT License
开发语言 JavaScript
所属分类 Web应用开发、 Web框架
软件类型 开源软件
地区 不详
投 递 者 黄泰宁
操作系统 跨平台
开源组织
适用人群 未知
 软件概览
ngx-bootstrap

ngx-bootstrap

The best way to quickly integrate Bootstrap 5 Bootstrap 4 or Bootstrap 3 Components with Angular


npm version
slack

Links

Table of contents

  1. Getting Started
  2. Usage & Demo
  3. Supporting
  4. Installation
  5. Compatibility
  6. Troubleshooting
  7. Contributing
  8. Credits
  9. License

Getting Started

ngx-bootstrap provides Bootstrap components powered by Angular, so you don't need to include original JS components.

Check our Getting started guide if it's your first project with Angular Bootstrap.

Usage & Demo

Bootstrap components for Angular applications, dozens of demos and API documentation could be found here:https://valor-software.com/ngx-bootstrap/.

Supporting NGX-Bootstrap

ngx-bootstrap is an Open Source (MIT Licensed) project, it's an independent project with ongoing development made possible thanks to the support of our awesome backers.If you also would like to show support or simply give back to Open Source community, please consider becoming a backer sponsor of ngx-bootstrap on OpenCollective.

All donated funds are managed transparently on OpenCollective and will be used solely for compensating work and expenses for contributors. Valor Software employees and contractors are not eligible to use these funds.

What's there for you? Proper recognition and exposure of your name/logo/website on our page.Our main sponsors will be presented under this section! Be the first!

Installation

Angular CLI way

Use the Angular CLI ng add command for updating your Angular project.

ng add ngx-bootstrap
Manual way

Install ngx-bootstrap from npm:

npm install ngx-bootstrap --save

Add wanted package to NgModule imports:

import { TooltipModule } from 'ngx-bootstrap/tooltip';

@NgModule({
  ...
  imports: [TooltipModule.forRoot(),...]
  ...
})

Add component to your page:

<button type="button" class="btn btn-primary"
        tooltip="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
  Simple demo
</button>

You will need to add bootstrap css:

  • Bootstrap 5
<!--- index.html -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous">
  • Bootstrap 4
<!--- index.html -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2">
  • Bootstrap 3
<!-- index.html -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

Setting up the bootstrap version manually

As you may know ngx-bootstrap support several bootstrap.css versions at the same time and has automatic tool to guess current used version of library, but if this guess fails you can specify version of bootstrap.css manually.

Sometimes, your project might contain some library that could interfere with the bootstrap framework, or you might have a customized version of bootstrap. The consequence is that the process of determining bootstrap version might be failed, which can break the UI. In that case, we can still set the bootstrap version manually in the bootstrapping component (i.e. AppComponent):

import { setTheme } from 'ngx-bootstrap/utils';

@Component({...})
export class AppComponent {
  constructor() {
    setTheme('bs3'); // or 'bs4'
    ...
  }
}

How to build lib for development

First time:

git clone https://github.com/valor-software/ngx-bootstrap.git
cd ngx-bootstrap
npm ci
npm run build
npm start

Compatibility

The only two dependencies are Angular and Bootstrap CSS.Here is the versions compatibility list:

ngx-bootstrap Angular Bootstrap CSS
7.1.0 11.x.x - 12.x.x 5.x.x 4.x.x or 3.x.x
7.0.0 11.x.x - 12.x.x 3.x.x or 4.x.x
6.0.0 9.x.x - 10.x.x 3.x.x or 4.x.x
5.6.x 7.x.x - 9.1.0 3.x.x or 4.x.x
5.0.0 - 5.6.0 7.x.x - 8.x.x 3.x.x or 4.x.x
4.x.x 6.x.x - 7.x.x 3.x.x or 4.x.x
3.x.x 6.x.x - 7.x.x 3.x.x or 4.x.x
2.x.x 2.x.x - 4.x.x 3.x.x or 4.x.x
1.x.x 2.x.x 3.x.x or 4.x.x

Troubleshooting

So if you are in trouble, here's where you can look for help.

The best place to ask questions is on StackOverflow (under the ngx-bootstrap tag)You can also join our Slack channel and link your stackoverflow question there. But try to avoid asking generic help questions directly on Slack since they can easily get lost in the chat. You can also search among the existing GitHub issues.

If, and only if, none of the above helped, please open a new issue.

Contribution

All contributions very welcome! And remember, contribution is not only PRs and code, but any help with docs or helping other developers to solve issues are very appreciated! Thanks in advance!

Please read our contribution guidelines.

Credits

Crossbrowser testing sponsored by SaucelabsSaucelabs

End-to-end testing sponsored by CypressCypress

License

MIT

  • 导入Module ... import { ModalModule} from 'ngx-bootstrap'; ... ... @NgModule({ declarations: [AddXXComponent], imports: [ ... ModalModule.forRoot() ... ] }) export class AddXXModule {

  • angular.bootstrap(document, ["myapp"]) ;//初始化 这种方式,一旦页面需要多个初始化时,可以用bootstrap,指令只能进行一次初始化操作 需要进行多个初始化时使用!!!! <script> var i=0; var m1 = angular.module('myApp1',[]); var m2 = ang

  • datepicker组件官方api: http://ngx-bootstrap.com/#/datepicker   step1. 安装 ngx-bootstrap  :              npm install  ngx-bootstrap --save step2 .引入相关文件:           在angular.json中的styles中引入相关的css文件,根据需要引入相应得

  • 问题: ERROR in Error: Metadata version mismatch for module F:/nodejs/angular4/mybootst rap3/node_modules/@ng-bootstrap/ng-bootstrap/index.d.ts, found version 4, expect ed 3, resolving symbol AppModule i

  • 安装依赖包 #安装webpack npm install webpack -g #自动生成一个package.json文件 npm init #将webpack增加到package.json文件中 npm install webpack --save-dev #如果想要安装开发工具 npm install webpack-dev-server --save-dev npm install angu

  • AngularJS Bootstrap AngularJS 的首选样式表是 Twitter Bootstrap, Twitter Bootstrap 是目前最受欢迎的前端框架。 查看 Bootstrap教程。 Bootstrap 你可以在你的 AngularJS 应用中加入 Twitter Bootstrap,你可以在你的 <head>元素中添加如下代码: <link rel="styleshee

  • 媒体查询 首先我们在使用Media的时候需要先设置下面这段代码,来兼容移动设备的展示效果: <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> 参数解释: width = device-width:宽度等于当前设备的宽度 initia

  • 1.如果想要你的应用自动启动Angular的话,那就把ng-app放在应用的根节点中,通常情况下是<html>标签中, <html ng-app> <html ng-app id="ng-app"> 自动初始化 Angular在以下两种情况下自动初始化:一个是DOMContentLoaded事件触发,或者在angular.js脚本被执行的同时如果document.readyState被置为'com

  • 一、轮播效果 概述: 这是一个循环滚动的幻灯片组件,可以使用文本、图象水平不间断滚动,如同旋转木马一般。 工作原理: 轮播效果是一个幻灯片效果,使用CSS 3D变形转换和一些JAvaScript构建一内容循环播放,它适用于一系列图像、文本或自定义标记,还包括对上一个/下一个图的浏览控制和指令支持。 在支持 Page Visibility API(页面可见性)的浏览器中,当网页对用户不可见时(如浏览

  • bootstrap: 1、选中select下拉框中的内容 $("#objId").find("option:contains('optionName')").attr("selected",true); 2、获取select下拉框中的内容 $("#objId").find("option:selected")[0].textContent

 相关资料
  • ngx-weui 是一个使用 Angular 构建的 WeUI 组件。 在线示例以及API文档。

  • ngx-fastdfs 是 nginx + lua +fastdfs 实现分布式图片实时动态压缩。 install 进入docker目录docker build -t  fastdfs:dev . 使用 docker -idt -p 80:80 fastdfs:dev /bin/bash进入容器执行/etc/rc.local 测试 进入容器执行test目录下的./test.sh或者直接执行下面脚本

  • ngx-markdown ngx-markdown is an Angular library that combines... Marked to parse markdown to HTML Prism.js for language syntax highlight Emoji-Toolkit for emoji support KaTeX for math expression rende

  • ngx-admin Who uses ngx-admin?| Documentation | Installation Guidelines | Angular templates New! Material theme for ngx-admin Material admin theme is based on the most popular Angular dashboard templat

  • @sweetalert2/ngx-sweetalert2 Official SweetAlert2 integration for Angular This is not a regular API wrapper for SweetAlert (which already works very well alone), it intends to provide Angular-esque ut

  • ngx-dropzone A lightweight and highly customizable Angular dropzone component for file uploads. For a demo see DEMO. And the CODE for the demo. Install $ npm install --save ngx-dropzone Usage // in ap