angular6

application can't find a .js file

一笑奈何 提交于 2020-02-23 07:15:44
问题 I have a Play application. The UI of the application is in Angular . I have created a folder ui which is the top level Angular directory. build.sbt `ui-dev-build` := { implicit val UIroot = baseDirectory.value / "ui" if (runDevBuild != Success) throw new Exception("Oops! UI Build crashed.") } def runDevBuild(implicit dir: File): Int = ifUiInstalled(runScript("npm run build")) package.json "build": "ng build --output-path ../public/ui", When the Angular application is build, I transfer the

application can't find a .js file

纵然是瞬间 提交于 2020-02-23 07:15:22
问题 I have a Play application. The UI of the application is in Angular . I have created a folder ui which is the top level Angular directory. build.sbt `ui-dev-build` := { implicit val UIroot = baseDirectory.value / "ui" if (runDevBuild != Success) throw new Exception("Oops! UI Build crashed.") } def runDevBuild(implicit dir: File): Int = ifUiInstalled(runScript("npm run build")) package.json "build": "ng build --output-path ../public/ui", When the Angular application is build, I transfer the

Angular 6 Signalr with MVC 5

强颜欢笑 提交于 2020-02-07 03:46:06
问题 I am using angular 6 with my current project which is in mvc 5 , all other things are working perfect, the only problem i am facing in implementing SignalR, this is my signalr.service.ts code: export class SignalRService { dataReceived = new EventEmitter<myData>(); connectionEstablished = new EventEmitter<Boolean>(); private connectionIsEstablished = false; private _hubConnection: HubConnection; constructor() { this.createConnection(); this.registerOnServerEvents(); this.startConnection(); }

Reducing line height in angular material tree

荒凉一梦 提交于 2020-02-04 02:29:07
问题 I am using a angular tree material to display JSON data, I am unsatisfied by the amount of white spacing there is between lines. I have tried playing with mat-tree-node.line-height in the css with zero changes. How can I reduce all this vertical white space? 回答1: Simply by overriding their css: .mat-tree-node { min-height: 30px } 回答2: The only working way I found with angular 8 on a nested element (and nested tree) is .mat-tree-node { min-height: 1.2em !important; height: 1.2em; } 来源: https:/

How do I select a ContentChild of a native element in Angular 6?

て烟熏妆下的殇ゞ 提交于 2020-02-02 06:09:55
问题 I have a component that uses content projection. <ng-content select="button"> </ng-content> I want to do something like this in my component: @ContentChild('button') button: ElementRef; However, when I check this.button , it is undefined both in ngAfterViewInit and ngAfterContentInit . How can I select my content child if it is a native element and not a custom component? 回答1: None of the query decorators can select native elements without a reference. @ViewChild('button') @ViewChildren(

How do I select a ContentChild of a native element in Angular 6?

空扰寡人 提交于 2020-02-02 06:08:45
问题 I have a component that uses content projection. <ng-content select="button"> </ng-content> I want to do something like this in my component: @ContentChild('button') button: ElementRef; However, when I check this.button , it is undefined both in ngAfterViewInit and ngAfterContentInit . How can I select my content child if it is a native element and not a custom component? 回答1: None of the query decorators can select native elements without a reference. @ViewChild('button') @ViewChildren(

WARNING in ./node_modules/pdfjs-dist/build/pdf.js Module not found: Error: Can't resolve 'zlib' in 'ui_angular_6\node_modules\pdfjs-dist\build'

别说谁变了你拦得住时间么 提交于 2020-02-02 05:15:28
问题 I was trying to migrate my angular 5 code to angular 6. After doing npm start getting the below problem npm start WARNING in ./node_modules/pdfjs-dist/build/pdf.js Module not found: Error: Can't resolve 'zlib' in '\ui_angular_6\node_modules\pdfjs-dist\build' Package.json "dependencies": { "@angular/animations": "6.0.2", "@angular/common": "6.0.2", "@angular/compiler": "6.0.2", "@angular/core": "6.0.2", "@angular/flex-layout": "^6.0.0-beta.15", "@angular/forms": "6.0.2", "@angular/http": "6.0

How to make google chrome go full screen in Angular 4 Application?

馋奶兔 提交于 2020-01-31 09:15:42
问题 I am developing an application where I want to implement such a thing where if user leaves from one component & enters other component, then in other component's ngOnInit method chrome browser should go full screen same as when we press Fn + F11 Key. Any help or references are appreciated. 回答1: You can try with requestFullscreen I have create a demo on Stackblitz fullScreen() { let elem = document.documentElement; let methodToBeInvoked = elem.requestFullscreen || elem.webkitRequestFullScreen

Angular 6 - can't resolve all parameters for AppComponent

前提是你 提交于 2020-01-31 04:44:29
问题 I am trying to build an application with Angular 6 and I am still setting everything up. But it seems there is something wrong with the dependency injection in my app. It cannot resolve any constructor parameter. They all result in Uncaught Error: Can't resolve all parameters for AppComponent: (?). . Even a custom service results in the same error. Versions (omitted the dependencies that can't have any influence on this) "dependencies": { "@angular/common": "6.0.5", "@angular/compiler": "6.0

call function of other component on event in one component in Angular 6

天大地大妈咪最大 提交于 2020-01-25 10:42:46
问题 I'm using Angular 6 . I have a component HeaderComponent whose html contain an input field like header.component.html <form> <input (keyup)="search($event)"> </form> <app-search-result-card *ngIf="searchQuery.length > 3" [searchQuery]="searchQuery"> </app-search-result-card> SearchResultComponent has a function to perform search export class SearchResultCardComponent implements OnInit { @Input() searchQuery: string; searching = true; constructor( private searchService: SearchService ) { }