Skip to content

Commit

Permalink
Migrated to output function
Browse files Browse the repository at this point in the history
  • Loading branch information
emonney committed Nov 28, 2024
1 parent b3aa965 commit bfd6741
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// (c) 2024 www.ebenmonney.com/mit-license
// ---------------------------------------

import { Component, OnInit, ViewChild, Output, EventEmitter, inject } from '@angular/core';
import { Component, OnInit, ViewChild, inject, output } from '@angular/core';
import { NgClass } from '@angular/common';
import { HttpErrorResponse } from '@angular/common/http';
import { NgForm, FormsModule } from '@angular/forms';
Expand All @@ -18,10 +18,10 @@ import { Permission, Permissions } from '../../models/permission.model';
import { GroupByPipe } from '../../pipes/group-by.pipe';

@Component({
selector: 'app-role-editor',
templateUrl: './role-editor.component.html',
styleUrl: './role-editor.component.scss',
imports: [FormsModule, NgClass, NgbTooltip, TranslateModule, GroupByPipe]
selector: 'app-role-editor',
templateUrl: './role-editor.component.html',
styleUrl: './role-editor.component.scss',
imports: [FormsModule, NgClass, NgbTooltip, TranslateModule, GroupByPipe]
})
export class RoleEditorComponent implements OnInit {
private alertService = inject(AlertService);
Expand All @@ -42,8 +42,7 @@ export class RoleEditorComponent implements OnInit {
public changesCancelledCallback: (() => void) | undefined;

// Outupt to broadcast this instance so it can be accessible from within ng-bootstrap modal template
@Output()
afterOnInit = new EventEmitter<RoleEditorComponent>();
readonly afterOnInit = output<RoleEditorComponent>();

@ViewChild('f')
private form!: NgForm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// (c) 2024 www.ebenmonney.com/mit-license
// ---------------------------------------

import { Component, ViewChild, ElementRef, Output, EventEmitter, HostListener, input } from '@angular/core';
import { Component, ViewChild, ElementRef, HostListener, input, output } from '@angular/core';
import { FormsModule } from '@angular/forms';

@Component({
Expand All @@ -16,8 +16,7 @@ import { FormsModule } from '@angular/forms';
export class SearchBoxComponent {
readonly placeholder = input('Search...');

@Output()
searchChange = new EventEmitter<string>();
readonly searchChange = output<string>();

@ViewChild('searchInput')
searchInput!: ElementRef;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// (c) 2024 www.ebenmonney.com/mit-license
// ---------------------------------------

import { Component, OnInit, ViewChild, Input, Output, EventEmitter, inject, input } from '@angular/core';
import { Component, OnInit, ViewChild, Input, inject, input, output } from '@angular/core';
import { HttpErrorResponse } from '@angular/common/http';
import { NgModel, NgForm, FormsModule } from '@angular/forms';
import { TranslateModule } from '@ngx-translate/core';
Expand Down Expand Up @@ -55,8 +55,7 @@ export class UserInfoComponent implements OnInit {
@Input() isGeneralEditor = false;

// Outupt to broadcast this instance so it can be accessible from within ng-bootstrap modal template
@Output()
afterOnInit = new EventEmitter<UserInfoComponent>();
readonly afterOnInit = output<UserInfoComponent>();

@ViewChild('f')
public form!: NgForm;
Expand Down

0 comments on commit bfd6741

Please sign in to comment.