Skip to content

Commit

Permalink
Migrate to Standalone API
Browse files Browse the repository at this point in the history
  • Loading branch information
bampakoa committed Jul 11, 2024
1 parent 65df3df commit ead3848
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 44 deletions.
14 changes: 13 additions & 1 deletion projects/demo-editor/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
import { CommonModule } from '@angular/common';
import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { RouterOutlet } from '@angular/router';
import { NgxNewsletterEditorComponent, NgxWebpageEditorComponent } from 'ngx-grapesjs';

@Component({
selector: 'app-root',
standalone: true,
imports: [
CommonModule,
FormsModule,
RouterOutlet,
NgxWebpageEditorComponent,
NgxNewsletterEditorComponent
],
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
styleUrl: './app.component.css'
})
export class AppComponent {
editorMode = '';
Expand Down
8 changes: 8 additions & 0 deletions projects/demo-editor/src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { ApplicationConfig } from '@angular/core';
import { provideRouter } from '@angular/router';

import { routes } from './app.routes';

export const appConfig: ApplicationConfig = {
providers: [provideRouter(routes)]
};
17 changes: 0 additions & 17 deletions projects/demo-editor/src/app/app.module.ts

This file was deleted.

3 changes: 3 additions & 0 deletions projects/demo-editor/src/app/app.routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Routes } from '@angular/router';

export const routes: Routes = [];
Binary file modified projects/demo-editor/src/favicon.ico
Binary file not shown.
11 changes: 5 additions & 6 deletions projects/demo-editor/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config';
import { AppComponent } from './app/app.component';

import { AppModule } from './app/app.module';


platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
bootstrapApplication(AppComponent, appConfig)
.catch((err) => console.error(err));
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('NgxNewsletterEditorComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [NgxNewsletterEditorComponent]
imports: [NgxNewsletterEditorComponent]
});
fixture = TestBed.createComponent(NgxNewsletterEditorComponent);
component = fixture.componentInstance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { NgxEditorComponent } from '../editor.component';

@Component({
selector: 'ngx-grapes-newsletter-editor',
template: '<div id="gjs"></div>'
template: '<div id="gjs"></div>',
standalone: true
})
export class NgxNewsletterEditorComponent extends NgxEditorComponent implements OnInit {

Expand Down
16 changes: 0 additions & 16 deletions projects/ngx-grapesjs/src/lib/ngx-grapesjs.module.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { Config } from '../editor.model';

@Component({
selector: 'ngx-grapes-webpage-editor',
template: '<div id="gjs"></div>'
template: '<div id="gjs"></div>',
standalone: true
})

export class NgxWebpageEditorComponent extends NgxEditorComponent implements OnInit {
Expand Down
1 change: 0 additions & 1 deletion projects/ngx-grapesjs/src/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
export * from './lib/newsletter-editor/ngx-newsletter-editor.service';
export * from './lib/newsletter-editor/ngx-newsletter-editor.component';
export * from './lib/webpage-editor/ngx-webgrapesjs.component';
export * from './lib/ngx-grapesjs.module';
export * from './lib/newsletter-editor/placeholder.model';

0 comments on commit ead3848

Please sign in to comment.