ng-bootstrap

Extract data from Json for ng-bootstrap typeahead

↘锁芯ラ 提交于 2019-12-03 18:53:29
问题 Trying to make Play Framework (REST) and ng-bootstrap - Typeahead work together. But I'm facing a problem with extracting data from json response. For example I write "test" (searches in database by name ), server returns json array(everything is right): [{ "id": 1, "name": "test", "annotation": "test annotation", "kiMin": 1, "kiMax": 2, "cosFiMin": 3, "cosFiMax": 4 }, { "id": 4, "name": "test2", "annotation": "test annotation", "kiMin": 1, "kiMax": 2, "cosFiMin": 3, "cosFiMax": 4 }] But the

Angular bootstrap date-range-picker in a popup?

我与影子孤独终老i 提交于 2019-12-03 16:45:57
I am trying to show a date-range picker in my angular app using ng-bootstrap. My code looks like following: <ngb-datepicker #dp ngModel (ngModelChange)="onDateChange($event)" [displayMonths]="2" [dayTemplate]="t"> </ngb-datepicker> <ng-template #t let-date="date" let-focused="focused"> <span class="custom-day" [class.focused]="focused" [class.range]="isFrom(date) || isTo(date) || isInside(date) || isHovered(date)" [class.faded]="isHovered(date) || isInside(date)" (mouseenter)="hoveredDate = date" (mouseleave)="hoveredDate = null"> {{ date.day }} </span> </ng-template> How should I show the

How can I access the 'select' method from NgbTabSet in the component in Angular2 and ng-bootstrap?

南笙酒味 提交于 2019-12-03 16:17:15
问题 Using Angular 2.3.1 and ng-bootstrap 1.0.0-alpha.18. I am trying to programmatically select a tab based on ID from the component rather than from within the template. The goal is to pull the param from the url and to use that to select the tab in ngOnInit the template <section id="policy-terms"> <ngb-tabset> <ngb-tab title="Terms and Privacy" id="terms"> <template ngbTabContent> <div class="container page-content"> </div> </template> </ngb-tab> <ngb-tab title="Company Policy" id="policy">

How to Style ng-bootstrap - Alternative to /deep/

荒凉一梦 提交于 2019-12-03 15:49:51
I am using the accordion component from ng-bootstrap in one of my apps and the /deep/ (aka: ::ng-deep and >>> ) selector to set its styles. However I saw this selector has been deprecated . Is there an alternative to set the styles of the ng-bootstrap components? Support for the emulated /deep/ CSS Selector (the Shadow-Piercing descendant combinator aka >>>) has been deprecated to match browser implementations and Chrome’s intent to remove. ::ng-deep has been added to provide a temporary workaround for developers currently using this feature. From here: http://angularjs.blogspot.com/2017/07

Open ng-bootstrap modal programmatically

血红的双手。 提交于 2019-12-03 10:56:18
I've got an angular 4 page including a ng-bootstrap modal. My code looks like this. foo.html [...] <button class="btn btn-sm btn-secondary material-icons" (click)="open(content)">search</button> <ng-template #content let-c="close" let-d="dismiss"> content in here </ng-template> [...] foo.ts [...] constructor(private modalService: NgbModal) { } [...] open(content) { let options: NgbModalOptions = { size: 'lg' }; this.modalService.open(content, options); } [...] Now when I click the button the modal opens. What I want to do now is open the model on ngChanges. ngOnChanges(changes: any) { open

ng-bootstrap not working in angular 4

笑着哭i 提交于 2019-12-03 10:30:18
I am new with angular 4, I am trying to configure bootstrap. I installed ng-bootstrap: https://ng-bootstrap.github.io/#/getting-started I did all like on the page, but I don't see the bootstrap on my page. Here is my code: src/app/app.module.ts import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; import { FormsModule } from '@angular/forms'; import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, FormsModule, // add this NgbModule

How to implement Bootstrap 4 for Angular 2 ngb-pagination

若如初见. 提交于 2019-12-03 06:39:59
I have a Angular2 app with a component where I have a table. Table is generated via *ngFor directive. Each row of the table is an object with 9 fields that is being loaded from the backend when the component is initialized. In the app I'm trying to use ng-bootstrap for angular module. ng-boorstrap In particular I'm trying to implement the pagination component. Could somebody explain how to put the code so it would render e.g. only 10 rows per page pls? Or give me a reference where the implementation is done. What I have done is: to put the NgbModule reference to my module where I'm declaring

How to programatically close ng-bootstrap modal?

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I've got a modal: <template # warningModal let-c = "close" let-d = "dismiss" > <div class = "modal-header" > <button type = "button" class = "close" aria-label = "Close" ( click ) = "d('Cross click')" > <span aria-hidden = "true" > × </span> </button> <h4 class = "modal-title" > Warning </h4> </div> <div class = "modal-body" > The numbers you have entered result in negative expenses. We will treat this as $0.00. Do you want to continue? </div> <div class = "modal-footer" > <button type = "button" class = "btn btn-secondary" ( click

angular6 使用tooltip

匿名 (未验证) 提交于 2019-12-02 23:43:01
准备 为了使用tooltip,可以安装ng-bootstrap组件,它包含两个依赖: angular:5.0以上版本; bootstrap css: 4.0版本。 安装好bootstrap之后,更新angular.json文件 "styles": [ "node_modules/bootstrap/dist/css/bootstrap.min.css" ] 需要注意的是只能引入css文件,不能引入其他的js依赖,例如:bootstrap.js, jQuery, popper.js。 安装ng-bootstrap npm install --save @ng-bootstrap/ng-bootstrap 引入到angular主模块中 import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; @NgModule({ ... imports: [NgbModule, ...], ... }) export class YourAppModule { } 在html文件中使用tooltip <button type="button" class="btn btn-outline-secondary mr-2" placement="top" ngbTooltip="Tooltip on top"> Tooltip on top <

NgbTypeahead component doesn't scroll inside a scrollable component

十年热恋 提交于 2019-12-02 16:31:32
问题 I am using NgbTypeahead component of ng-bootstrap. My problem is, when I put the typeahead component inside a scrollable component and make a scroll down, the position of dropdown container doesn't change. <div style="height: 300px; overflow-y: auto;"> ... <input id="typeahead-template" type="text" class="form-control [(ngModel)]="model" [ngbTypeahead]="search" [resultTemplate]="rt [inputFormatter]="formatter" /> ... </div> It could be a small CSS issue but I could not find the solution. Here