-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09c27d6
commit 79356f8
Showing
6 changed files
with
136 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
packages/sitecore-jss-angular/src/test-data/lazy-component.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { ComponentRendering } from '@sitecore-jss/sitecore-jss/layout'; | ||
import { MockService } from './mock.service'; | ||
import { Component, Input } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'lazy-component', | ||
template: ` | ||
{{ rendering?.fields?.linkText?.value }} | ||
{{ getNum() }} | ||
`, | ||
}) | ||
export class LazyComponent { | ||
@Input() rendering: ComponentRendering; | ||
|
||
constructor(private mockService: MockService) {} | ||
|
||
getNum() { | ||
return this.mockService.get(10); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/sitecore-jss-angular/src/test-data/lazy-loading.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { MockService } from './mock.service'; | ||
import { LazyComponent } from './lazy-component.component'; | ||
import { JssModule } from '../lib.module'; | ||
|
||
@NgModule({ | ||
imports: [JssModule.forChild(LazyComponent)], | ||
declarations: [LazyComponent], | ||
providers: [MockService], | ||
}) | ||
export class AngularLazyLoadingModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Injectable } from '@angular/core'; | ||
|
||
@Injectable() | ||
export class MockService { | ||
get(num: number): number { | ||
return num; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters