ngx-bootstrap

How to instantiate In angular2 ngx-bootstrap modal when the modal is open

柔情痞子 提交于 2019-12-25 12:11:51
问题 This is my parent component template fragment: <button type="button" (click)="addModal.show();">Add</button> <add-modal #addModal></add-modal> And this is my modal component: Component({ selector: 'card-add-modal', template: ` <div *ngIf="isShowModal" bsModal #addModal="bs-modal" [config]="{show: true, backdrop: 'static'}" (onHidden)="onHidden()" class="modal fade"> <!-- header... --> <div class="modal-body"> <input type="text" name="name" id="name" [(ngModel)]="model.test"> </div> <!--

ngx-bootstrap datepicker option to pick only month and a year

自古美人都是妖i 提交于 2019-12-25 00:28:06
问题 I'm using ngx-botstrap BsDatepickerModule for my application form and I have a requirement to pick only a month. Does anyone know where I can find a solution? This issue has been raised almost a year ago and looks like it is highly demanded, so I conceal a hope to get an answer. This is what I would like to see after clicking a date selector button: 回答1: I managed to solve this using the same bsDatepicker, with minimal effort Component template: <form class="container"> <input [(ngModel)]=

Populating/patching values of angular reactive forms

亡梦爱人 提交于 2019-12-25 00:26:45
问题 I'm curently working on crud application using angular 4, I'm wondering, how can I populate my reactive form with the data that's been parsed in the same row with the button that opens up the form, form is inside ngx-bootstrap modal and it should be the same one I have on the other button for adding new item/object? Here's the code, I hope I can present my problem to you properly... I should noted that I have a working form for adding new employee, and want to use same one but want to

How to stop TAB key event from firing when a modal is open

情到浓时终转凉″ 提交于 2019-12-24 17:18:15
问题 When the modal is showing, how can I disable key events like TAB? I have multiple buttons and fields in a form on the page that can be selected (focused) by tabbing. I want to disable that when the modal is showing. The application uses Angular and the modal is in a child component. <button tabindex="0">Button1</button> <button tabindex="0">Button2</button> <form>...</form> <div id="myModal" class="modal fade" role="dialog"> <div class="modal-dialog"> <div class="modal-content">...</div> <

How to get access to `BsModalRef` in opened modal component?

烂漫一生 提交于 2019-12-24 10:14:36
问题 I'm quite new to Angular 4.I have been working on Angular 1.5.x and now converting same application in Angular 4 with ngUpgrade hybrid approach. I'm using ngx-bootstrap modal component in my hybrid application in order to replace existing modal service. I found some problem in following guide ngx-bootstrap-modal with service. Having problem with this statement If you passed a component to .show() you can get access to opened modal by injecting BsModalRef I'm copying same example here, export

Module '“/Users/***/my-app4/src/app/datepicker/datepicker.component”' has no exported member 'DatepickerModule'

不羁岁月 提交于 2019-12-24 09:27:53
问题 I already asked the following question. ngx-bootstrap datepicker doesnt work Now I face a new problem. I separated files and the new error showed up. ERROR in /Users/ /my-app4/src/app/app.component.ts (2,10): Module '"/Users/ /my-app4/src/app/datepicker/datepicker.component"' has no exported member 'DatepickerModule'. Could you help me? app.component.ts import { Component } from '@angular/core'; import { DatepickerModule } from './datepicker/datepicker.component'; @Component({ selector: 'app

how to make a ngfor always start from the first position in angular

我与影子孤独终老i 提交于 2019-12-24 06:55:40
问题 I have a cycle for use to show a carousel (I'm using the ngx-bootstrap carousel) the problem is that when I click on "see details" and if I change the images of the modal slider, I close the modal and open another image in The main carousel starts from the position where it was when opening the previous modal. I explain: I click on "see details" and the 2 carousel opens where I show all the images of that house / apartment, if I change the images and for example, it goes to the third image,

how to make a ngfor always start from the first position in angular

独自空忆成欢 提交于 2019-12-24 06:53:55
问题 I have a cycle for use to show a carousel (I'm using the ngx-bootstrap carousel) the problem is that when I click on "see details" and if I change the images of the modal slider, I close the modal and open another image in The main carousel starts from the position where it was when opening the previous modal. I explain: I click on "see details" and the 2 carousel opens where I show all the images of that house / apartment, if I change the images and for example, it goes to the third image,

Ngx-Bootstrap popover not setting correct height or width

丶灬走出姿态 提交于 2019-12-24 00:59:50
问题 I am trying to use ngx-bootstrap in my Ionic 2 / Angular 2 app and for some reason the popover is not displaying correctly in my view: <button placement="right" [outsideClick]="true" popover="this is a teseofnwifo ef efo efoih wefohwefo wef h ioef whefhweofihwoeht" [isOpen]="true" triggers="click" ion-button full outline class="flex-col rounded box-shadow" color="primary" style="height:100%;font-size:16px;border-width:1px;" (click)="goTo('new-client')" #1> <i class="fa fa-user-plus text

How pass data from ModalService into component

雨燕双飞 提交于 2019-12-20 05:32:25
问题 I'm trying to use ngx-bootstrap-modal to pass data from a modal service into a modal component. The examples show this: this.modalService.show(ModalContentComponent, {initialState}); But it doesn't show how the ModalContentComponent actually consumes that state. I've played around in a debugger and I never see my component getting that data. How do I access it from the component? 回答1: You can also use the BsModalRef content Like my-modal.component.ts export class MyModalComponent { public