auto migrate standalone components

This commit is contained in:
2025-01-05 10:26:35 +01:00
parent 8b8395fc3c
commit 54ee9a5b11
121 changed files with 947 additions and 685 deletions

View File

@@ -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;

View File

@@ -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 {
}

View File

@@ -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;

View File

@@ -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 {
}

View File

@@ -9,8 +9,8 @@ describe('UserNameComponent', () => {
beforeEach(
waitForAsync(() => {
void TestBed.configureTestingModule({
declarations: [UserNameComponent],
}).compileComponents();
imports: [UserNameComponent],
}).compileComponents();
}),
);

View File

@@ -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;

View File

@@ -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 {
}