ng-bootstrap

How to implement ng-bootstrap 4 table sorting, pagination and filtering

旧城冷巷雨未停 提交于 2020-08-01 05:22:12
问题 I am going through the official documentation of ng-bootstrap, in some of their official examples, the code is not working. In particular I am talking about this and this examples, when you open them in stackblitz. This makes it hard for me to understand how the code works so that I can implement it my way. I have seen this question but the answer is outdated as it is for angularjs. So now my questions is: How can I implement ng-bootstrap 4 table sorting, pagination and filtering as shown

Ng-bootstrap and Angular 9 compatibility

喜你入骨 提交于 2020-07-21 07:07:30
问题 After upgrading to Angular 9, I am getting the following errors relative to ng-bootstrap: ERROR in src/app/shared/Components/form-controls/dropdown-select/dropdown-select.component.ts:87:63 - error TS2304: Cannot find name 'NgbDropdownMenu'. 87 @ViewChild('dropdownMenu', { static: false }) dropDownMenu: NgbDropdownMenu; ~~~~~~~~~~~~~~~ src/app/private/private-shared/Services/ngb-modal-stack-extend.service.ts:1:39 - error TS2305: Module '"../../../../../../../../../../../node_modules/@ng

Angular Install ng-bootstrap: Cannot find module '@schematics/angular/utility/project'

无人久伴 提交于 2020-07-09 06:48:50
问题 The system throws error during ng-bootstrap installation: [error] Error: Cannot find module '@schematics/angular/utility/project' Require stack: - C:\angular\gis-semantics-framework\node_modules\@ng-bootstrap\ng-bootstrap\schematics\ng-add\index.js - C:\angular\gis-semantics-framework\node_modules\@angular-devkit\schematics\tools\export-ref.js - C:\angular\gis-semantics-framework\node_modules\@angular-devkit\schematics\tools\index.js - C:\angular\gis-semantics-framework\node_modules\@angular

How to do jasmine unit test case for angular 6 bootstrap 4 modal

浪子不回头ぞ 提交于 2020-07-07 07:38:06
问题 html <ng-template #content let-modal> <h1>Modal content inside this ng-template #content </h1> </ng-template> Button to open model <button (click)="open(content)" > Open modal </button> In ts file import { NgbModal, ModalDismissReasons } from '@ng-bootstrap/ng-bootstrap'; constructor( public modalService: NgbModal) { } open(content) { this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title', size: 'lg' }).result.then((result) => { this.closeResult = `Closed with: ${result}`; },

How to detect date selection in ng-bootstrap Datepicker on input field?

六眼飞鱼酱① 提交于 2020-06-27 07:27:47
问题 We use the ng-bootstrap Datepicker as Directive in our project: <input class="form-control" name="dp" ngbDatepicker #d="ngbDatepicker" (blur)="d.close()" [(ngModel)]="model" (ngModelChange)="onDateSelected()"> The current behaviour is that onDateSelected() is called when a date in the datepicker is selected, as well as every time a change is made to the input field. The desired behaviour is that onDateSelected() is called whenever the user clicks on a date in the datepicker or moves the

How can I use typeahead to fetch/present objects but take in and respond with strings?

浪子不回头ぞ 提交于 2020-06-16 03:51:08
问题 The ng-bootstrap typeahead element allows fetching an array of object suggestions and then selecting one so that the model becomes the selected object. The full code can be seen in this Plunkr. Test it by searching for a US state then observing the model output. Here is the template: <label for="typeahead-template">Search for a state:</label> <input id="typeahead-template" type="text" class="form-control" [(ngModel)]="model" [ngbTypeahead]="search" [resultTemplate]="rt" [inputFormatter]=

What is the “let-” attribute in Angular 6?

允我心安 提交于 2020-05-25 17:04:53
问题 In the ng-bootstrap modal documentation there are uses of some kind of let-* attribute that seemed to be used to link a function or event for later use. If you look at the (click) events and the let-c / let-d attributes at the top of the examples, you can get a feel for what it does. This appears to be a feature of Angular and has nothing to do with ng-bootstrap . But what is this called? What does it do? Where are the Angular docs for this feature? Here's an example of what I'm referring to.

Width and background color of ng bootstrap tooltip

泄露秘密 提交于 2020-05-15 06:05:16
问题 I need to modify the width of the tooltip box and the background of it too. How can I achieve it? I am using angular2 and ng bootstrap. <i class="fa fa-info-circle info-icon-background" [ngbTooltip]="tooltipContent" aria-hidden="true" ></i> I have tried putting the following in my "task-modal.component.css" css file but it does not seem to work. Please help. .tooltip-inner{ width: 400px; background-color: #FFFFFF; } In my angular component, I specify the css file as: @Component({ selector:

Extend ng-boostrap popover component with custom angular directive

核能气质少年 提交于 2020-05-09 07:52:40
问题 What i try to achieve is to extend ngbPopover directive and wrap in custom directive all this proeprties so instead of showing them just to include my directive. For example i am using ngbpopover like this: <button type="button" class="btn btn-primary mb-4" placement="right-top" [ngbPopover]="popOver" popoverClass="popover-custom" #popOverRef="ngbPopover" triggers="manual" [autoClose]="false" (click)="popOverRef.toggle()" (hidden)="onPopoverClose(options)" > Standard Picker </button> <ng

ng-bootstrap modal animation

♀尐吖头ヾ 提交于 2020-05-08 06:35:11
问题 The fade class doesn't appear to work on the ngb-modal. I've looked at trying to apply my own animation to the modal but the modal template is obviously injected into modal dialogue by ng-bootstrap e.g. I don't have access to the modal dialogue. I only have access to the template: <template #content let-c="close" let-d="dismiss"> <div class="modal-header card-header" style="border-radius: 10px;"> <h4 class="modal-title">Contact Form</h4> </div> <div class="modal-body"> </div> ...etc <