auto migrate standalone components
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
import {Directive, ElementRef, Input, OnInit, TemplateRef, ViewContainerRef} from '@angular/core';
|
||||
import {UserService} from './user.service';
|
||||
|
||||
@Directive({
|
||||
selector: '[appOwner]',
|
||||
standalone: false,
|
||||
})
|
||||
@Directive({ selector: '[appOwner]', })
|
||||
export class OwnerDirective implements OnInit {
|
||||
private currentUserId: string | null = null;
|
||||
private iAppOwner: string | null = null;
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {OwnerDirective} from './owner.directive';
|
||||
import {CommonModule} from '@angular/common';
|
||||
|
||||
@NgModule({
|
||||
declarations: [OwnerDirective],
|
||||
exports: [OwnerDirective],
|
||||
imports: [CommonModule],
|
||||
})
|
||||
export class OwnerModule {
|
||||
}
|
||||
@@ -4,10 +4,7 @@ import {UserService} from './user.service';
|
||||
import {User} from './user';
|
||||
import {combineLatest} from 'rxjs';
|
||||
|
||||
@Directive({
|
||||
selector: '[appRole]',
|
||||
standalone: false,
|
||||
})
|
||||
@Directive({ selector: '[appRole]', })
|
||||
export class RoleDirective implements OnInit {
|
||||
@Input() public appRole: roles[] = [];
|
||||
private currentUser: User | null = null;
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {RoleDirective} from './role.directive';
|
||||
|
||||
@NgModule({
|
||||
declarations: [RoleDirective],
|
||||
exports: [RoleDirective],
|
||||
imports: [CommonModule],
|
||||
})
|
||||
export class RoleModule {
|
||||
}
|
||||
@@ -9,8 +9,8 @@ describe('UserNameComponent', () => {
|
||||
beforeEach(
|
||||
waitForAsync(() => {
|
||||
void TestBed.configureTestingModule({
|
||||
declarations: [UserNameComponent],
|
||||
}).compileComponents();
|
||||
imports: [UserNameComponent],
|
||||
}).compileComponents();
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
@@ -2,12 +2,13 @@ import {Component, Input} from '@angular/core';
|
||||
import {UserService} from '../user.service';
|
||||
import {map} from 'rxjs/operators';
|
||||
import {Observable} from 'rxjs';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'app-user-name',
|
||||
templateUrl: './user-name.component.html',
|
||||
styleUrls: ['./user-name.component.less'],
|
||||
standalone: false,
|
||||
selector: 'app-user-name',
|
||||
templateUrl: './user-name.component.html',
|
||||
styleUrls: ['./user-name.component.less'],
|
||||
imports: [AsyncPipe],
|
||||
})
|
||||
export class UserNameComponent {
|
||||
public name$: Observable<string | null> | null = null;
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {UserNameComponent} from './user-name.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [UserNameComponent],
|
||||
exports: [UserNameComponent],
|
||||
imports: [CommonModule],
|
||||
})
|
||||
export class UserNameModule {
|
||||
}
|
||||
Reference in New Issue
Block a user