ng-bootstrap

ngbPopover will not close and will open on load

拜拜、爱过 提交于 2020-01-06 05:24:06
问题 I want to show the popover once the page load or without trigerring the button and will never close I'm using ngbPopover in Angular. <button placement="left" (click)="openQuestionnaire()" [ngbPopover]="popContent" >0/4</button> using the reference here : https://ng-bootstrap.github.io/#/components/popover/examples 回答1: You have to add this property to your button: [autoClose]="false" Then your button would look like this: <button placement="left" (click)="openQuestionnaire()" [ngbPopover]=

Angular: How to detect toggle status in ng-bootstrap dropdown where there are several dropdowns

霸气de小男生 提交于 2020-01-06 02:34:43
问题 I recently asked this question and it was well answered. But I have another question: How to detect toggle status in ng-bootstrap dropdown where there are several dropdowns? When I try doing it returns the status of the firstdropdown only. I cannot use a unique id as they don't contain the 'isopen()' method. How can I detect toggle status in ng-bootstrap dropdown where there are several dropdowns? 回答1: I would do something like this: I get all the dropdowns with ViewChildren @ViewChildren

NgbModule ng-bootstrap for angular2 is not working

ぃ、小莉子 提交于 2020-01-05 07:03:26
问题 Imported it in app.module.ts like, import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; added it in imports:[NgbModule.forRoot()] while compiling it is giving WARNING in ./~/@ng-bootstrap/ng-bootstrap/datepicker/datepicker-input.js 188:12-21 "export 'Renderer2' was not found in '@angular/core' WARNING in ./~/@ng-bootstrap/ng-bootstrap/modal/modal-window.js 61:12-21 "export 'Renderer2' was not found in '@angular/core' WARNING in ./~/@ng-bootstrap/ng-bootstrap/popover/popover.js 119:12-21

mark-disabled ng-bootstrap not working with other datepickers examples

别说谁变了你拦得住时间么 提交于 2020-01-04 05:50:12
问题 I am trying to use the range selection and the global configuration from the ng-bootstrap datepicker example. But the config.mark-disabled doesn't seem to apply in my code: It's almost only code from the examples from the link above. I changed the fromDate and toDate value to see if there was a conflict with the days that should be disabled, but it didn't help. my .ts file : import { Booking } from '../booking/booking.model'; import { BookingDataService } from '../booking-data.service';

ng-bootstrap - ngbtooltip not working with [(ngModel)]

好久不见. 提交于 2020-01-03 19:33:08
问题 I'm new to angular 4 and bootstrap beta 2 and trying to use ngbtooltip to show tool tip text. Tooltip on the label is working fine when only input does not have [(ngModel)] . As soon as I used [(ngModel)] in input text control, tooltip is showing only for the first label and other labels does not. In the below code, if I remove ngModel , all labels tooltips are shown as expected. <div class="col-lg-12 col-md-12 col-sm-12 "> <div class="col-lg-12 col-md-12 col-sm-12 container accordion" id=

Webpack2 Angular2 ng-bootstrap Tree Shaking

橙三吉。 提交于 2020-01-03 18:44:11
问题 I'm currently using https://github.com/ng-bootstrap/ng-bootstrap in my angular2 application and use webpack2 to build all ts files. i'm only using Modal Component from NgbModule for now, but in minified file i can still see NbgAccordian and other modules reference which is not used in my app @ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.15 i tried import { NgbModule, NgbModal, NgbModalOptions, ModalDismissReasons, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; but didn't worked as expected

Webpack2 Angular2 ng-bootstrap Tree Shaking

本秂侑毒 提交于 2020-01-03 18:44:06
问题 I'm currently using https://github.com/ng-bootstrap/ng-bootstrap in my angular2 application and use webpack2 to build all ts files. i'm only using Modal Component from NgbModule for now, but in minified file i can still see NbgAccordian and other modules reference which is not used in my app @ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.15 i tried import { NgbModule, NgbModal, NgbModalOptions, ModalDismissReasons, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; but didn't worked as expected

Two way binding not working in ng-bootstrap radio button in an angular reactive form

点点圈 提交于 2020-01-03 03:20:25
问题 I am developing an application with Angular 4, Bootstrap 4 and ngbootstrap. The html code - <div class="container"> <form [formGroup]="myForm" novalidate (ngSubmit)="save(myForm.value)"> <div class="form-group"> <div class="row"> <legend class="col-form-legend col-sm-2">Required</legend> <div class="btn-group col-sm-2" ngbRadioGroup name="isRequired" formControlName="isRequired"> <label ngbButtonLabel class="btn-primary"> <input ngbButton type="radio" name="radio" [value]="true">Yes </label>

How to use ng-bootstrap with AngularJS 2 (using angular-cli v1b15)?

跟風遠走 提交于 2020-01-02 07:16:58
问题 I have been trying to use ng-bootstrap in my Angular 2 project following the documentation on the ng-bootstrap official site. What I have done are as follow: npm install bootstrap@4.0.0-alpha.4 Navigate to the root /bootstrap directory and run npm install to install local dependencies listed in package.json. Navigate to the root project again and run npm install --save @ng-bootstrap/ng-bootstrap After that, I import in the module as follows: import { BrowserModule } from '@angular/platform

Ng-Bootstrap Datepicker, how to highlight specific days in Angular4

余生颓废 提交于 2020-01-01 14:49:08
问题 I have an array of tasks, each contains a date. I would like to highlight the matching days in the datepicker but cannot seem to find in the documentation how to accomplish it. Anyone able to help? https://ng-bootstrap.github.io/#/components/datepicker/api Here is my typescript: import { Component, OnInit } from '@angular/core'; import {NgbDateStruct} from '@ng-bootstrap/ng-bootstrap'; const now = new Date(); @Component({ selector: 'app-dashboard', templateUrl: './dashboard.component.html',