-
Notifications
You must be signed in to change notification settings - Fork 105
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
65036cb
commit b075b34
Showing
26 changed files
with
422 additions
and
557 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { ApplicationConfig } from '@angular/core'; | ||
import { provideAnimations } from '@angular/platform-browser/animations'; | ||
import { provideRouter } from '@angular/router'; | ||
import { mergeApplicationConfig, ApplicationConfig } from '@angular/core'; | ||
import { provideServerRendering } from '@angular/platform-server'; | ||
import { APP_ROUTES } from './app.routes'; | ||
import { appConfig } from './app.config'; | ||
|
||
export const appServerConfig: ApplicationConfig = { | ||
providers: [provideRouter(APP_ROUTES), provideAnimations(), provideServerRendering()] | ||
const serverConfig: ApplicationConfig = { | ||
providers: [provideServerRendering()] | ||
}; | ||
|
||
export const config = mergeApplicationConfig(appConfig, serverConfig); |
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 |
---|---|---|
@@ -1,59 +1,12 @@ | ||
import { | ||
AfterViewInit, | ||
ChangeDetectionStrategy, | ||
ChangeDetectorRef, | ||
Component | ||
} from '@angular/core'; | ||
import { NguCarouselConfig } from '@ngu/carousel'; | ||
import { interval, Observable } from 'rxjs'; | ||
import { map, startWith, take } from 'rxjs/operators'; | ||
import { slider } from './slide-animation'; | ||
import { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
import { MainNavComponent } from './main-nav/main-nav.component'; | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'app-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.scss'], | ||
animations: [slider], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
imports: [MainNavComponent] | ||
}) | ||
export class AppComponent implements AfterViewInit { | ||
images = ['assets/bg.jpg', 'assets/car.png', 'assets/canberra.jpg', 'assets/holi.jpg']; | ||
|
||
public carouselTileItems$: Observable<number[]>; | ||
public carouselTileConfig: NguCarouselConfig = { | ||
grid: { xs: 1, sm: 1, md: 1, lg: 5, all: 0 }, | ||
speed: 250, | ||
point: { | ||
visible: true | ||
}, | ||
touch: true, | ||
loop: true, | ||
interval: { timing: 1500 }, | ||
animation: 'lazy' | ||
}; | ||
tempData: any[]; | ||
|
||
constructor(private cdr: ChangeDetectorRef) { | ||
this.tempData = []; | ||
|
||
this.carouselTileItems$ = interval(500).pipe( | ||
startWith(-1), | ||
take(30), | ||
map(() => { | ||
const data = (this.tempData = [ | ||
...this.tempData, | ||
this.images[Math.floor(Math.random() * this.images.length)] | ||
]); | ||
|
||
return data; | ||
}) | ||
); | ||
} | ||
|
||
ngAfterViewInit() { | ||
this.cdr.detectChanges(); | ||
} | ||
} | ||
export class AppComponent {} |
6 changes: 1 addition & 5 deletions
6
apps/ngu-carousel-example/src/app/banner-vertical/banner-vertical.component.html
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
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
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
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
Oops, something went wrong.