Skip to content

Commit

Permalink
docs(components): ajusta documentação para aplicações standalone
Browse files Browse the repository at this point in the history
Atualiza a documentação do po-accordion, page-slide, list-view, tree-view e navBar
para suportar aplicações standalone.

Para standalone:
- Usar CommonModule ao invés de BrowserModule.
- Adicionar configuração de bootstrap com BrowserAnimationsModule.

Fixes accordion/DTHFUI-9707
  • Loading branch information
renanarosario authored and CSimoesJr committed Nov 21, 2024
1 parent 38a9e03 commit b363101
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 0 deletions.
12 changes: 12 additions & 0 deletions projects/ui/src/lib/components/po-accordion/po-accordion.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ import { PoAccordionComponent } from './po-accordion.component';
* })
* export class AppModule { }
* ```
*
* Em aplicações Standalone, utilize a seguinte configuração para o bootstrap:
*
* ```
* import { bootstrapApplication } from '@angular/platform-browser';
* import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
* import { AppComponent } from './app.component';
*
* bootstrapApplication(AppComponent, {
* providers: [importProvidersFrom(BrowserAnimationsModule)]
* }).catch(err => console.error(err));
* ```
*/
@NgModule({
imports: [CommonModule, PoTagModule, PoIconModule, PoDividerModule, PoTooltipModule],
Expand Down
12 changes: 12 additions & 0 deletions projects/ui/src/lib/components/po-list-view/po-list-view.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ import { PoContainerModule } from '../po-container/po-container.module';
* })
* export class AppModule { }
* ```
*
* Em aplicações Standalone, utilize a seguinte configuração para o bootstrap:
*
* ```
* import { bootstrapApplication } from '@angular/platform-browser';
* import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
* import { AppComponent } from './app.component';
*
* bootstrapApplication(AppComponent, {
* providers: [importProvidersFrom(BrowserAnimationsModule)]
* }).catch(err => console.error(err));
* ```
*/
@NgModule({
imports: [
Expand Down
12 changes: 12 additions & 0 deletions projects/ui/src/lib/components/po-navbar/po-navbar.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ import { PoNavbarComponent } from './po-navbar.component';
* })
* export class AppModule { }
* ```
*
* Em aplicações Standalone, utilize a seguinte configuração para o bootstrap:
*
* ```
* import { bootstrapApplication } from '@angular/platform-browser';
* import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
* import { AppComponent } from './app.component';
*
* bootstrapApplication(AppComponent, {
* providers: [importProvidersFrom(BrowserAnimationsModule)]
* }).catch(err => console.error(err));
* ```
*/
@NgModule({
imports: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,41 @@ import { convertToBoolean } from '../../../utils/util';
* > Para o correto funcionamento do componente `po-page-slide`, deve ser
* > importado o módulo `BrowserAnimationsModule` no módulo principal da sua
* > aplicação.
*
* Módulo da aplicação:
* ```
* import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
* import { PoModule } from '@po-ui/ng-components';
* ...
*
* @NgModule({
* imports: [
* BrowserModule,
* BrowserAnimationsModule,
* ...
* PoModule
* ],
* declarations: [
* AppComponent,
* ...
* ],
* providers: [],
* bootstrap: [AppComponent]
* })
* export class AppModule { }
* ```
*
* Em aplicações Standalone, utilize a seguinte configuração para o bootstrap:
*
* ```
* import { bootstrapApplication } from '@angular/platform-browser';
* import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
* import { AppComponent } from './app.component';
*
* bootstrapApplication(AppComponent, {
* providers: [importProvidersFrom(BrowserAnimationsModule)]
* }).catch(err => console.error(err));
* ```
*/
@Directive()
export class PoPageSlideBaseComponent {
Expand Down
12 changes: 12 additions & 0 deletions projects/ui/src/lib/components/po-slide/po-slide.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ import { PoSlideItemComponent } from './po-slide-item/po-slide-item.component';
* })
* export class AppModule { }
* ```
*
* Em aplicações Standalone, utilize a seguinte configuração para o bootstrap:
*
* ```
* import { bootstrapApplication } from '@angular/platform-browser';
* import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
* import { AppComponent } from './app.component';
*
* bootstrapApplication(AppComponent, {
* providers: [importProvidersFrom(BrowserAnimationsModule)]
* }).catch(err => console.error(err));
* ```
*/
@NgModule({
imports: [CommonModule, RouterModule, PoContainerModule, PoIconModule],
Expand Down
12 changes: 12 additions & 0 deletions projects/ui/src/lib/components/po-tree-view/po-tree-view.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ import { PoTreeViewItemHeaderComponent } from './po-tree-view-item-header/po-tre
* })
* export class AppModule { }
* ```
*
* Em aplicações Standalone, utilize a seguinte configuração para o bootstrap:
*
* ```
* import { bootstrapApplication } from '@angular/platform-browser';
* import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
* import { AppComponent } from './app.component';
*
* bootstrapApplication(AppComponent, {
* providers: [importProvidersFrom(BrowserAnimationsModule)]
* }).catch(err => console.error(err));
* ```
*/
@NgModule({
declarations: [PoTreeViewComponent, PoTreeViewItemComponent, PoTreeViewItemHeaderComponent],
Expand Down

0 comments on commit b363101

Please sign in to comment.