angular6

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 navigate to other page in angular 6?

北战南征 提交于 2020-07-05 02:43:47
问题 Im trying to redirect my page from login to another page. Im following this code. My login component ts file: import { Router } from '@angular/router'; constructor(private router: Router) { } funLogin(mobilenumber){ this.router.navigateByUrl('registration'); } In my html Im calling this function in a submit btn, <button class="common-btn btn" (click)="funLogin(mobileNo.value)">Submit</button> In my app.login.routing file, export const loginRouting: Routes = [ { path: '', component:

Problems in moving from Development mode to Production mode

无人久伴 提交于 2020-06-29 04:07:47
问题 I have an Angular application which I serve from Play Framework. To do this, the index.html of Play loaded the Angular js files like follows <script src="@routes.Assets.versioned("ui/runtime.js")" type="text/javascript"></script> <script src="@routes.Assets.versioned("ui/vendor.js")" type="text/javascript"></script> <script src="@routes.Assets.versioned("ui/styles.js")" type="text/javascript"></script> <script src="@routes.Assets.versioned("ui/main.js")" type="text/javascript"></script>

Escape Function Doesn't Get Called When Close FullScreen in Angular

元气小坏坏 提交于 2020-06-27 04:58:27
问题 I have a problem when i try to press the esc function so that the fullscreen of my app will close. The fullscreen and close fullscreen already works. But the problem is when i'm currently in fullscreen mode and i try to click the esc, it closes the fullscreen but the word "Open" is still being shown. Please see my codes below. Please click also my stackblizk link here https://stackblitz.com/edit/fullscreen-closefullscreen?file=src%2Fapp%2Fapp.component.ts @HostListener('document:keydown

Resolver does not resolve if another data stream is added

痴心易碎 提交于 2020-06-23 08:33:30
问题 I am trying to use a resolver in order to retrieve data depending on the given parameters the route holds. Unfortunately, the moment I add another data stream that my data depends on the resolver never actually resolves. If I directly return an immediately resolving value everything works fine. I debugged the situation to see that I receive all partial information but it just fails to actually resolve in the end. Here's a quick sample. Hit me up if there's more code needed to understand the

How to record desktop screen in angular 2+ application

﹥>﹥吖頭↗ 提交于 2020-06-23 07:18:33
问题 I need to share desktop screen via Angular 6 . I have searched for suitable package to implement this feature but couldn't found it. Actually I found many packages like RecordRTC, Aperture, screen-capture-recorder and some others. Some of them were incompatible, some were poorly documented and non-availability of code-intellisense. Please tell me the most compatible and well documented package that I can use with Angular 6 . Platform I am working on is Windows 回答1: Finally find some working

How to record desktop screen in angular 2+ application

和自甴很熟 提交于 2020-06-23 07:15:37
问题 I need to share desktop screen via Angular 6 . I have searched for suitable package to implement this feature but couldn't found it. Actually I found many packages like RecordRTC, Aperture, screen-capture-recorder and some others. Some of them were incompatible, some were poorly documented and non-availability of code-intellisense. Please tell me the most compatible and well documented package that I can use with Angular 6 . Platform I am working on is Windows 回答1: Finally find some working

Unable to change text of a Button in Angular

佐手、 提交于 2020-06-17 15:13:11
问题 My template has a button <button #showTmplButton (click)="showTemplate()">Show Template </button> I am getting reference of the button in the component's class and I want to toggle the text of the button but I am unable to do so. What am I doing wrong? @ViewChild("showTmplButton") showTmplButton:ElementRef; showTmpl:boolean=false; constructor(private renderer:Renderer2, hostElementRef:ElementRef){ } showTemplate(){ this.showTmpl=!this.showTmpl; if(this.showTmpl){ this.renderer.setAttribute

Angular6 - Prod build fails to access

房东的猫 提交于 2020-06-17 13:24:10
问题 I'm converting my angular6 app to a pwa and facing some troubles. When I run the app with ng serve, everythings works fine. When I publish the app or run with ng serve --prod, the app open but fails to load the login screen with an error in the console "ReferenceError: Subscription is not defined". The error is comming from "SubjectSubscription.js.pre-build-optimizer.js" here is my tsconfig.json { "compileOnSave": false, "compilerOptions": { "moduleResolution": "node", "target": "es6",

Angular6 - Prod build fails to access

↘锁芯ラ 提交于 2020-06-17 13:24:06
问题 I'm converting my angular6 app to a pwa and facing some troubles. When I run the app with ng serve, everythings works fine. When I publish the app or run with ng serve --prod, the app open but fails to load the login screen with an error in the console "ReferenceError: Subscription is not defined". The error is comming from "SubjectSubscription.js.pre-build-optimizer.js" here is my tsconfig.json { "compileOnSave": false, "compilerOptions": { "moduleResolution": "node", "target": "es6",