How to use @sitecore-jss/sitecore-jss-angular - 4 common examples

To help you get started, we’ve selected a few @sitecore-jss/sitecore-jss-angular examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Sitecore / jss / samples / basic-sample-angular / src / app / app.module.ts View on Github external
@NgModule({
  declarations: [
    AppComponent,
    WelcomeComponent,
    NotFoundComponent,
    ServerErrorComponent,
    JssRouteComponent
  ],
  imports: [
    // withServerTransition is needed to enable universal rendering
    BrowserModule.withServerTransition({ appId: 'my-app' }),
    BrowserTransferStateModule,
    HttpClientModule,
    AppRoutingModule,
    AppJssInfrastructureModule,
    JssModule.withComponents([
      { name: 'Welcome', type: WelcomeComponent }
    ])
  ],
  bootstrap: [
    AppComponent
  ]
})
export class AppModule { }
github Sitecore / jss / samples / angular / src / app / routing / jss-route-resolver.service.ts View on Github external
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<JssState> {
    // in experience editor, we need to reload to avoid confusing the editor ribbon
    if (isExperienceEditorActive() && window) {
      const currentLocation = window.location.pathname + window.location.search + window.location.hash;
      if (currentLocation !== state.url) {
        window.location.assign(state.url);
        return null;
      }
    }

    // route params are created by custom route matcher in app-routing.module
    return this.jssService.changeRoute(route.params.serverRoute, route.params.language);
  }
}
github Sitecore / jss / samples / basic-sample-angular / src / app / app.component.spec.ts View on Github external
beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [
        AppComponent
      ],
      imports: [
        JssModule.withComponents([])
      ],
      providers: [
        { provide: JssService, useClass: MockService }
      ]
    }).compileComponents();
  }));
github Sitecore / jss / samples / angular / src / app / components / styleguide-layout-tabs / styleguide-layout-tabs.component.ts View on Github external
update() {
    this.tabs = getChildPlaceholder(this.rendering, 'jss-tabs').filter((tab: ComponentRendering) => tab.fields) as ComponentRendering[];

    if (!this.activeTab && this.tabs.length > 0) {
      this.activeTab = this.tabs[0];
    }
  }
}

@sitecore-jss/sitecore-jss-angular

This module is provided as a part of Sitecore JavaScript Rendering SDK (JSS). It contains Angular integration components and services for JSS.

Apache-2.0
Latest version published 8 days ago

Package Health Score

63 / 100
Full package analysis

Similar packages