AngularJS is a JavaScript framework.
Angular is an open-source, front-end web application development framework, it is TypeScript-based and led by the Angular Team at Google and by a community of individuals and corporations.
A : I follow these steps to create animation in angular.Enabling the animations module by importing import { BrowserAnimationsModule } from '@angular/platform-browser/animations' in your app.module.ts filenext you need to create animation.ts file and write below code .import { animate, query, style, transition, trigger, group,} from '@angular/animations';export function routerAnimation() { return trigger('routerAnimation', [ // One time initial load. Move page from left -100% to 0% transition('-1 => *', [ query(':enter', [ style({ position: 'fixed', width: '100%', transform: 'translateX(-100%)', }), animate( '500ms ease', style({ opacity: 1, transform: 'translateX(0%)', }), ), ]), ]), // Previous, slide left to right to show left page transition(':decrement', [ // set new page X location to be -100% query( ':enter', style({ position: 'fixed', width: '100%', transform: 'translateX(-100%)', }), ), group([ // slide existing page from 0% to 100% to the right query( ':leave', animate( '500ms ease', style({ position: 'fixed', width: '100%', transform: 'translateX(100%)', }), ), ), // slide new page from -100% to 0% to the right query( ':enter', animate( '500ms ease', style({ opacity: 1, transform: 'translateX(0%)', }), ), ), ]), ]), // Next, slide right to left to show right page transition(':increment', [ // set new page X location to be 100% query( ':enter', style({ position: 'fixed', width: '100%', transform: 'translateX(100%)', }), ), group([ // slide existing page from 0% to -100% to the left query( ':leave', animate( '500ms ease', style({ position: 'fixed', width: '100%', transform: 'translateX(-100%)', }), ), ), // slide new page from 100% to 0% to the left query( ':enter', animate( '500ms ease', style({ opacity: 1, transform: 'translateX(0%)', }), ), ), ]), ]), ]);}next in your app-routing.module.ts file,write below code where routes define ,{ path: 'abc', component: AbcComponent, data: { num: 1 } }{ path: 'test', component: TestComponent, data: { num: 2 } }next in your app.component.ts file you need to write below code,import { routerAnimation } from './common/animations';import { Component } from '@angular/core';import { RouterOutlet } from '@angular/router';@Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'], animations: [routerAnimation()],})export class AppComponent { constructor() {} public getRouteAnimation(outlet: RouterOutlet) { const res = outlet.activatedRouteData.num === undefined ? -1 : outlet.activatedRouteData.num; return res; }}next in app.component.html file you need to write below code,
A : Hi,You can try this code, it is working Fine in my project.In Template file you can write below code after constructor.originalOrder = (a: KeyValue, b: KeyValue): number => {
return 0;
} And in html component file you can write below code.write this code in ngfor pipe keyvalue.
A : hi use this{
path: "user",//use full path
loadChildren: () => import("app/modules/user/user.module").then(m => m.UserModule)
}allow full path// Full path including `src` at the start:
loadChildren: "src/app/customers/customers.module#CustomersModule"
A : hi you can use these line of codeNgxJsonLdModule.forRoot(); //no need to call forRoot function;@NgModule({
declarations: [AppComponent],
imports: [
AppRoutingModule,
NgtUniversalModule,
NgxJsonLdModule
],
providers: []
})
export class AppModule {}