1616 See the License for the specific language governing permissions and
1717 limitations under the License.
1818- %>
19- import { Directive, HostListener, Input, contentChild, effect, inject } from '@angular/core';
19+ import { Directive, HostListener, contentChild, effect, inject, input } from '@angular/core';
2020import { FaIconComponent } from '@fortawesome/angular-fontawesome';
2121import { faSort, faSortDown, faSortUp, IconDefinition } from '@fortawesome/free-solid-svg-icons';
2222
@@ -26,7 +26,7 @@ import { SortDirective } from './sort.directive';
2626 selector: '[<%= jhiPrefix %> SortBy]',
2727})
2828export class SortByDirective {
29- @Input() <%= jhiPrefix %> SortBy!: string;
29+ readonly <%= jhiPrefix %> SortBy = input.required< string >() ;
3030
3131 iconComponent = contentChild(FaIconComponent);
3232
@@ -41,7 +41,7 @@ export class SortByDirective {
4141 if (this.iconComponent()) {
4242 let icon: IconDefinition = this.sortIcon;
4343 const { predicate, order } = this.sort.sortState();
44- if (predicate === this.<%= jhiPrefix %> SortBy && order !== undefined) {
44+ if (predicate === this.<%= jhiPrefix %> SortBy() && order !== undefined) {
4545 icon = order === 'asc' ? this.sortAscIcon : this.sortDescIcon;
4646 }
4747 this.iconComponent()!.icon = icon.iconName;
@@ -53,7 +53,7 @@ export class SortByDirective {
5353 @HostListener('click')
5454 onClick(): void {
5555 if (this.iconComponent()) {
56- this.sort.sort(this.<%= jhiPrefix %> SortBy);
56+ this.sort.sort(this.<%= jhiPrefix %> SortBy() );
5757 }
5858 }
5959}
0 commit comments