forked from unlayer/angular-email-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
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
21e703d
commit 53cd55a
Showing
16 changed files
with
260 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { Routes, RouterModule } from '@angular/router'; | ||
|
||
import { DashboardComponent } from './dashboard.component'; | ||
import { DesignListComponent } from './design-list/design-list.component'; | ||
import { DesignEditComponent } from './design-edit/design-edit.component'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: 'dashboard', | ||
component: DashboardComponent, | ||
children: [ | ||
{ path: '', component: DesignListComponent }, | ||
{ path: 'new', component: DesignEditComponent }, | ||
{ path: 'edit/:designId', component: DesignEditComponent } | ||
] | ||
} | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule] | ||
}) | ||
export class DashboardRoutingModule { } |
Empty file.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
<router-outlet></router-outlet> |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { DashboardComponent } from './dashboard.component'; | ||
|
||
describe('DashboardComponent', () => { | ||
let component: DashboardComponent; | ||
let fixture: ComponentFixture<DashboardComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ DashboardComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(DashboardComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-dashboard', | ||
templateUrl: './dashboard.component.html', | ||
styleUrls: ['./dashboard.component.css'] | ||
}) | ||
export class DashboardComponent implements OnInit { | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
import { DashboardRoutingModule } from './dashboard-routing.module'; | ||
import { EmailEditorModule } from 'email-editor'; | ||
|
||
import { DashboardComponent } from './dashboard.component'; | ||
import { DesignListComponent } from './design-list/design-list.component'; | ||
import { DesignEditComponent } from './design-edit/design-edit.component'; | ||
|
||
@NgModule({ | ||
declarations: [DashboardComponent, DesignListComponent, DesignEditComponent], | ||
imports: [ | ||
CommonModule, | ||
DashboardRoutingModule, | ||
EmailEditorModule | ||
] | ||
}) | ||
export class DashboardModule { } |
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
:host { | ||
height: 100%; | ||
display: block; | ||
} | ||
|
||
.container { | ||
display: flex; | ||
flex-direction: column; | ||
position: relative; | ||
height: 100%; | ||
} | ||
|
||
#bar { | ||
flex: 1; | ||
background-color: #dc0027; | ||
color: #fff; | ||
padding: 10px; | ||
display: flex; | ||
max-height: 40px; | ||
} | ||
|
||
#bar h1 { | ||
flex: 1; | ||
font-size: 16px; | ||
text-align: left; | ||
} | ||
|
||
#bar button { | ||
flex: 1; | ||
padding: 10px; | ||
margin-left: 10px; | ||
font-size: 14px; | ||
font-weight: bold; | ||
background-color: #000; | ||
color: #fff; | ||
border: 0px; | ||
max-width: 150px; | ||
cursor: pointer; | ||
} | ||
|
||
#bar a { | ||
flex: 1; | ||
padding: 10px; | ||
margin-left: 10px; | ||
font-size: 14px; | ||
font-weight: bold; | ||
color: #fff; | ||
border: 0px; | ||
cursor: pointer; | ||
text-align: right; | ||
text-decoration: none; | ||
line-height: 160%; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<div class="container"> | ||
<div id="bar"> | ||
<h1>Angular Email Editor (Demo)</h1> | ||
<a routerLink="/dashboard">Dashboard</a> | ||
|
||
<button (click)="saveDesign()">Save Design</button> | ||
<button (click)="exportHtml()">Export HTML</button> | ||
</div> | ||
|
||
<email-editor | ||
[options]="options" | ||
(loaded)="editorLoaded($event)" | ||
#editor | ||
></email-editor> | ||
</div> |
25 changes: 25 additions & 0 deletions
25
src/app/dashboard/design-edit/design-edit.component.spec.ts
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { DesignEditComponent } from './design-edit.component'; | ||
|
||
describe('DesignEditComponent', () => { | ||
let component: DesignEditComponent; | ||
let fixture: ComponentFixture<DesignEditComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ DesignEditComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(DesignEditComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Component, OnInit, ViewChild } from '@angular/core'; | ||
import { EmailEditorComponent } from 'email-editor'; | ||
|
||
@Component({ | ||
selector: 'app-design-edit', | ||
templateUrl: './design-edit.component.html', | ||
styleUrls: ['./design-edit.component.css'] | ||
}) | ||
export class DesignEditComponent implements OnInit { | ||
|
||
options = { | ||
}; | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
@ViewChild('editor') | ||
private emailEditor: EmailEditorComponent; | ||
|
||
editorLoaded(event) { | ||
} | ||
|
||
saveDesign() { | ||
this.emailEditor.saveDesign( | ||
(data) => console.log('saveDesign', data) | ||
); | ||
} | ||
|
||
exportHtml() { | ||
this.emailEditor.exportHtml( | ||
(data) => console.log('exportHtml', data) | ||
); | ||
} | ||
|
||
} |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<h1>My Designs</h1> | ||
|
||
<p><a routerLink="/dashboard/new">New Design</a></p> |
25 changes: 25 additions & 0 deletions
25
src/app/dashboard/design-list/design-list.component.spec.ts
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { DesignListComponent } from './design-list.component'; | ||
|
||
describe('DesignListComponent', () => { | ||
let component: DesignListComponent; | ||
let fixture: ComponentFixture<DesignListComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ DesignListComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(DesignListComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-design-list', | ||
templateUrl: './design-list.component.html', | ||
styleUrls: ['./design-list.component.css'] | ||
}) | ||
export class DesignListComponent implements OnInit { | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
} |
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