How to give a `TemplateRef` as an `@Input` arg to a Story?

I’m trying to make a Story that uses a component that takes a TemplateRef as an @Input. But I can’t figure out how. TestComponent @Component({ selector: ‘test’, templateUrl: ‘./test.component.html’, }) export class TestComponent { @Input() public set value(value: TemplateRef<void>) { // … } } Story export default { title: ‘Components/Test’, component: TestComponent, } as Meta; […]

By Sn bj rn
Published
Categorized as angular, angular-storybook, storybook Tagged , ,

How to configure msal-angular interceptor to send an access token (v2) to own domain (self)

I updated to @azure/msal-angular v2 from v1. And I cannot figure out how to configure it to send an access token to my backend hosted on the same domain. So when my frontend makes a request to /api/foo then the MsalInterceptor should attach my access token in the version 2 format – not version 1. […]

Microsoft Edge Developer Tools for Visual Studio Code doesn’t auto attach debugger to Angular project

I’m having some issues getting the "auto attach debugger" feature of Microsoft Edge Developer Tools for Visual Studio Code to work. I generated a fresh angular project (ng new) and added this launch.json config { "configurations": [ // this one works. It opens a chrome window and hits my break points. { "type": "pwa-chrome", // […]

Possible to use the new template context syntax in @Input: TemplateRef?

I’m trying to utilize the new template syntax to pass a template with parameters to a custom component. I tried to implement it here, but it doesn’t work. https://stackblitz.com/edit/angular-mpohjp hello.component.ts import { Component, Input, TemplateRef } from ‘@angular/core’; @Component({ selector: ‘hello’, template: ` <h1>Hello {{name}}!</h1> <ng-container *ngTemplateOutlet=”template”></ng-container> `, styles: [`h1 { font-family: Lato; }`] }) […]

By Sn bj rn
Published
Categorized as angular

Can’t get controller reference in directive linkFn

how to Can’t get controller reference in directive linkFn I’m trying to porting the angular-unit-converter directive to typescript in [email protected] However I cannot get angularjs to inject the controller for the require directive. It throws Cannot read property ‘$parsers’ of undefined Because ngModel is undefined. Here’s my attempt // typescript conversion of https://github.com/alexandernst/angular-unit-converter import { […]

By Sn bj rn
Published
Categorized as typescript Tagged ,

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq