mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 12:53:03 -05:00
Additions/52 lazy load component (#963)
* feat: create challenge 52 on lazy load component Initial boilerplate from `nx g @angular-challenges/cli:challenge` * feat: revert to NgModule Copy of 31 * feat: initial version of starting point * feat: add documentation * feat: pr tweaks Add author file Remove thomas from the contributor list Add a more direct hint * feat: pr tweaks Update "Go to the latest Challenge" link
This commit is contained in:
22
apps/angular/52-lazy-load-component/src/app/app.component.ts
Normal file
22
apps/angular/52-lazy-load-component/src/app/app.component.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Component, signal } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
template: `
|
||||
<div class="h-screen bg-gray-500">
|
||||
@if (topLoaded()) {
|
||||
<app-top />
|
||||
} @else {
|
||||
<app-placeholder />
|
||||
<button
|
||||
class="rounded-sm border border-blue-500 bg-blue-300 p-2"
|
||||
(click)="topLoaded.set(true)">
|
||||
Load Top
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
`,
|
||||
})
|
||||
export class AppComponent {
|
||||
topLoaded = signal(false);
|
||||
}
|
||||
Reference in New Issue
Block a user