ng-bootstrap

Animation for carousel with ng-boostrap and Angular 2

核能气质少年 提交于 2019-11-29 07:55:26
I am using the carousel component with ng-bootstrap . I understand there's an open issue for a proper animation feature that works correctly with the angular 2 component life cycle right now ( Github issue ). My question: is there a way to use CSS as a workaround for the animation? I have put up a plunker that has fade in effect for the carousel, but not fade out. .carousel-item.active{ -webkit-animation: fadein 1.4s; -moz-animation: fadein 1.4s; -ms-animation: fadein 1.4s; -o-animation: fadein 1.4s; animation: fadein 1.4s; } @keyframes fadein { from { opacity: 0; } to { opacity: 1; } } /*

Angular 2 - How does ng-bootstrap provide the NgbRadioGroup and NgbButtonLabel to their NgbRadio directive?

落花浮王杯 提交于 2019-11-29 04:53:31
Here is the label code: import {Directive} from '@angular/core'; @Directive({ selector: '[ngbButtonLabel]', host: {'[class.btn]': 'true', '[class.active]': 'active', '[class.disabled]': 'disabled', '[class.focus]': 'focused'} }) export class NgbButtonLabel { active: boolean; disabled: boolean; focused: boolean; } and here is the radio button code: import {Directive, forwardRef, Input, Renderer2, ElementRef, OnDestroy} from '@angular/core'; import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms'; import {NgbButtonLabel} from './label'; const NGB_RADIO_VALUE_ACCESSOR = { provide:

Alternative to /deep/

痞子三分冷 提交于 2019-11-28 10:14:37
I want to change the styles of ng bootstrap pagination component and using /deep/ links in an Angular 6 app. The following code works fine but the console is showing a warning that the code is deprecated. So, how should I change it to get rid of the warning? Here is the CSS code I am currently using: ngb-pagination /deep/ .page-item.disabled .page-link{ background: none; } ngb-pagination /deep/ .page-item.active .page-link { background-color: #223C61; &:focus, &:visited{ outline: none; box-shadow: none; } } An alternative to using /deep/ or ::ng-deep is to disable View Encapsulation on your

Angular 2 ng-bootstrap close Modal

ⅰ亾dé卋堺 提交于 2019-11-28 09:12:44
I am trying to close the modal that was presented to me through the open(content) function as shown in the example in the Documentation of ng-boostrap. In the website, it mentioned that i can call close or dismiss from NgbActiveModal. So I included NgbActiveModal in the component and tried to call dismiss() or close(). Both of them doesn't work. First of all, dismiss() is undefined (Am I importing NgbActiveModal wrong?) When I call close(), it seems to want to call some weird function inside lib.dom.d.ts which is not what I want at all. So to me it seems like I have no access to the close and

How to programmatically close ng-bootstrap modal?

坚强是说给别人听的谎言 提交于 2019-11-28 06:48:57
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)="c('Close click')">No</button> <button type="button" class="btn btn-secondary" (click)="submit()">Yes<

Angular 2+ & ngBootstrap - Shared Modals

℡╲_俬逩灬. 提交于 2019-11-28 06:37:04
问题 Is it possible to have a ngBootstrap modal as a shared component and use an instance of it in other components. I'd like to have one Modal that prompts the user to delete a record and I'd like to re-use it across multiple components with different record types. ngBootstrap site shows a "Components As Content" example but in that example it looks like the ModalComponent dictates whether to open or close the ModalContents. I'd like the ability to open/close an instance of a modal from another

Angular2 + ng-bootstrap Example

拜拜、爱过 提交于 2019-11-28 04:43:45
问题 I started to learn Angular2 and I want to use ng-bootstrap in my project. However, I could not make a working project. It fails on importing ng-bootstrap. Since I am a beginner, I don't know if the problem is because of the code or something other that I made wrong. Can you provide me a working and simple project with ng-bootstrap and Angular2 so I can try to make it work on my computer? Edit: app.module.ts: import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular

Animation for carousel with ng-boostrap and Angular 2

て烟熏妆下的殇ゞ 提交于 2019-11-27 22:39:38
问题 I am using the carousel component with ng-bootstrap. I understand there's an open issue for a proper animation feature that works correctly with the angular 2 component life cycle right now (Github issue). My question: is there a way to use CSS as a workaround for the animation? I have put up a plunker that has fade in effect for the carousel, but not fade out. .carousel-item.active{ -webkit-animation: fadein 1.4s; -moz-animation: fadein 1.4s; -ms-animation: fadein 1.4s; -o-animation: fadein

Is it correct to implement a custom NgbDateParserFormatter to change the format of the input value on NgbInputDatepicker?

老子叫甜甜 提交于 2019-11-27 17:49:26
I'm using the datepicker ( ng-boostrap ) in a popup and I would like to change the date format to dd-mm-yyyy . It seems that it can be solved by implementing a new NgbDateParserFormatter to replace the default NgbDateISOParserFormatter . But I was wondering if there is another way. UPDATE: A small implementation of NgbDateParserFormatter using Moment.js (tested with version 1.0.0-alpha.14 of ng-bootstrap): import {NgbDateParserFormatter, NgbDateStruct} from '@ng-bootstrap/ng-bootstrap'; import * as moment from 'moment'; export class NgbDateMomentParserFormatter extends NgbDateParserFormatter {

What is the difference between “ng-bootstrap” and “ngx-bootstrap”?

孤者浪人 提交于 2019-11-27 17:32:51
What is the difference between "ng-bootstrap" and "ngx-bootstrap"? Are they related to each other? Or are they simply concurrent implementations? Has someone worked with them both and can give/explain pros and cons of both? With "ng-bootstrap" I mean https://ng-bootstrap.github.io/#/home and with "ngx-bootstrap" I mean http://valor-software.com/ngx-bootstrap/ . Both related to Angular 4 ( not to AngularJS! ) and Bootstrap 4. Please note that this ist not a duplicated question of difference between ngx-bootstrap and ng2 bootstrap? . ng-bootstrap and ngx-bootstrap are two different projects by