I am wondering how to use the DirectiveResolver
object to alter a given Component
.
Dependencies (ng2 moves so fast these days things become obsolete quickly)
"@angular/common": "~2.4.3",
"@angular/compiler": "~2.4.3",
"@angular/core": "~2.4.3",
I have tried this:
import { Component } from '@wwwalkerrun/nativescript-ngx-magic';
import { OnInit, Directive, Type } from '@angular/core';
import { DirectiveResolver } from '@angular/compiler';
class myViewResolver extends DirectiveResolver {
resolve(type: Type<any>, throwIfNotFound?: boolean): Directive {
var view = super.resolve(type, throwIfNotFound);
console.log(type);
console.log(view);
return view;
}
}
@Component({
selector: 'app-root',
templateUrl: 'views/app/app.component.html',
styleUrls: ['views/app/app.component.css'],
providers: [myViewResolver]
})
export class AppComponent {
title = 'app works!';
}
But I don't get the logs so I suspect the resolver is not executed.
Any idea?
ps: no entry in the official angular.io api documentation...