angular

Open a Modal Using an Option from a Dropdown - Angular 2 + ngx

怎甘沉沦 提交于 2021-02-10 11:57:49
问题 Using ngx-bootstrap (4) with Angular 2/CLI. Trying to use a dropdown list to select which modal to open. The modal currently works fine if I just have a button for each modal (not a dropdown), but the requirements call for a dropdown. I tried something like <select class="detailsOption" (change)="openModal($event.target.value)"> <option value="">Select Option</option> <option value={{modal1}} >Option 1</option> <option value={{modal2}}>Option 2</option> </select> <ng-template #modal1> </ng

Open a Modal Using an Option from a Dropdown - Angular 2 + ngx

不羁岁月 提交于 2021-02-10 11:57:09
问题 Using ngx-bootstrap (4) with Angular 2/CLI. Trying to use a dropdown list to select which modal to open. The modal currently works fine if I just have a button for each modal (not a dropdown), but the requirements call for a dropdown. I tried something like <select class="detailsOption" (change)="openModal($event.target.value)"> <option value="">Select Option</option> <option value={{modal1}} >Option 1</option> <option value={{modal2}}>Option 2</option> </select> <ng-template #modal1> </ng

MatDialog not showing

和自甴很熟 提交于 2021-02-10 11:55:44
问题 I want to add a dialog to my application, but for some reason it is not showing. The dialog component: import { Component, OnInit } from '@angular/core'; import {MatDialogRef} from "@angular/material"; @Component({ selector: 'app-connect-to-player-dialog', templateUrl: './connect-to-player-dialog.component.html', styleUrls: ['./connect-to-player-dialog.component.css'] }) export class ConnectToPlayerDialogComponent implements OnInit { constructor() { } ngOnInit() { } } The method used:

MatDialog not showing

浪尽此生 提交于 2021-02-10 11:51:06
问题 I want to add a dialog to my application, but for some reason it is not showing. The dialog component: import { Component, OnInit } from '@angular/core'; import {MatDialogRef} from "@angular/material"; @Component({ selector: 'app-connect-to-player-dialog', templateUrl: './connect-to-player-dialog.component.html', styleUrls: ['./connect-to-player-dialog.component.css'] }) export class ConnectToPlayerDialogComponent implements OnInit { constructor() { } ngOnInit() { } } The method used:

Angular components injection issues

一曲冷凌霜 提交于 2021-02-10 08:43:12
问题 I am currently experiencing a problem using the principles of component injection in angular. I have a header component that must use in another I called WelcomePage Component. My goal is that the header component can use the methods and properties of its parents. To do this I created the following abstract class: export abstract class WelcomeInterface { default: any; languagesSorted: any; /** * Change app language * @param langSelect language choice */ abstract onChangeLang(langSelect:

Angular components injection issues

萝らか妹 提交于 2021-02-10 08:42:56
问题 I am currently experiencing a problem using the principles of component injection in angular. I have a header component that must use in another I called WelcomePage Component. My goal is that the header component can use the methods and properties of its parents. To do this I created the following abstract class: export abstract class WelcomeInterface { default: any; languagesSorted: any; /** * Change app language * @param langSelect language choice */ abstract onChangeLang(langSelect:

Unable to draw correctly on canvas after zooming in/out ( Scaling)

我的梦境 提交于 2021-02-10 07:38:19
问题 I am unable to draw correctly after scaling. The aim is to allow users to draw rectangles on the image. I am using canvas to display the image and then draw rectangles on image, this is working fine. But now I am trying to add zoom in and zoom out functionality. I need to move the rectangle after zooming in/out , I am able to do so correctly. I have 3 arrays where I am saving the rectangle coordinates: drawItems : Initial rectangle coordinates on draw currentItems : Coordinates after scaling

Angular ngFor ngIF condition in data filtering by pipe

倖福魔咒の 提交于 2021-02-10 07:32:33
问题 ngFor filtering based on a search using pipe - This is working fine , Now I have to add ngIf condition based on the search query If nothing result then I have to show another new div with 'no data' text <input type="text" [(ngModel)]="queryString" placeholder="Search to type"> <li *ngFor="let project of projects | FilterPipe: queryString ;> {{project.project_name}} </li> //pipe transform(value: any, input:any ): any { if(input){ input = input.toLowerCase(); return value.filter(function (el:

Angular ngFor ngIF condition in data filtering by pipe

坚强是说给别人听的谎言 提交于 2021-02-10 07:31:40
问题 ngFor filtering based on a search using pipe - This is working fine , Now I have to add ngIf condition based on the search query If nothing result then I have to show another new div with 'no data' text <input type="text" [(ngModel)]="queryString" placeholder="Search to type"> <li *ngFor="let project of projects | FilterPipe: queryString ;> {{project.project_name}} </li> //pipe transform(value: any, input:any ): any { if(input){ input = input.toLowerCase(); return value.filter(function (el:

unable to change the background color in Angular using style binding

五迷三道 提交于 2021-02-10 07:27:12
问题 The background color of the div is not changing when using the style binding using Angular.The code is placed below for reference @Component({ selector: 'course', template: ` <div [style.backgroundColor]='red'> <button (click)="onClick($event)" class="btn btn-primary" [class.active]="isActive" [style.backgroundColor]='red'>Save</button> </div> `, styleUrls: ['./course.component.css'] }) export class CourseComponent {...} The style element has the backgroundColor property. Where am I going