Skip to content

Commit

Permalink
trying to reproduce #189
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejtreder committed Apr 5, 2018
1 parent 8a8a501 commit fcdab0c
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 11 deletions.
2 changes: 1 addition & 1 deletion application/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion application/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Maciej Treder <contact@maciejtreder.com>",
"description": "Angular Universal PWA boilerplate for serverless environment.",
"name": "angular-universal-pwa",
"version": "1.1.0",
"version": "1.1.2",
"repository": {
"type": "git",
"url": "git+https://github.com/maciejtreder/angular-universal-serverless.git"
Expand Down
7 changes: 6 additions & 1 deletion application/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import { CommonModule } from '@angular/common';
import { HttpClientModule } from '@angular/common/http';
import { Meta, Title } from '@angular/platform-browser';
import { PrebootModule } from 'preboot';
import { FormTestComponent } from './form-test/form-test.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';

@NgModule({
declarations: [
Expand All @@ -33,16 +35,19 @@ import { PrebootModule } from 'preboot';
MenuComponent,
DonorsComponent,
WithTransferStateComponent,
WithoutTransferStateComponent
WithoutTransferStateComponent,
FormTestComponent
],
imports: [
FormsModule,
MatButtonModule,
MatSnackBarModule,
MatMenuModule,
TranslateModule.forChild(),
CommonModule,
RouterModule.forRoot([
{ path: '', component: HomeComponent, data: {title: 'Home', description: 'Homepage - quick overview.'}},
{path: 'forms', component: FormTestComponent},
{ path: 'donors', component: DonorsComponent, data: {title: 'Donors', description: 'List of donations. Became a donor!'}},
{ path: 'lazy', loadChildren: './lazy/lazy.module#LazyModule', data: {title: 'Lazy module', description: 'Lazy module example.'}},
// { path: 'external', loadChildren: '@angular-universal-serverless/external-module/release#ExternalModule', data: {title: 'External module', description: 'External module example.'}}, not works because of https://github.com/angular/angular-cli/issues/8284
Expand Down
Empty file.
7 changes: 7 additions & 0 deletions application/src/app/form-test/form-test.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

<form #formName="ngForm" (ngSubmit)="onSubmit()">
<select *ngIf="segment.breathCycle.length > 1" [(ngModel)]="segment.selectedDuration" name="selectedDuration">
<option *ngFor="let d of segment.breathCycle;" [ngValue]="d">{{d.breathCycleDuration}}</option>
</select>
<input type="submit" value="submit" />
</form>
26 changes: 26 additions & 0 deletions application/src/app/form-test/form-test.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-form-test',
templateUrl: './form-test.component.html',
styleUrls: ['./form-test.component.css']
})
export class FormTestComponent implements OnInit {
public segment = {
breathCycle: [
{breathCycleDuration: 10},
{breathCycleDuration: 15},
{breathCycleDuration: 20}
]
}

constructor() { }

ngOnInit() {
}

onSubmit() {
console.log('form submitted');
console.log(this.segment);
}
}
10 changes: 2 additions & 8 deletions application/src/index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<html lang="en">
<html lang="en">
<head>

<link rel="dns-prefetch" href="https://www.google-analytics.com">
<script async src="https://cdn.ampproject.org/v0.js"></script>

<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="Progressive Web App created with Angular Universal, deployed on Amazon Lambda. Includes Angular Material, push notifications and external modules (for microservices purpose).">
Expand Down Expand Up @@ -69,14 +68,9 @@

<title>Angular Universal PWA - Progressive Web App deployed on AWS Lambda - starter/boilerplate</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script async custom-element="amp-install-serviceworker"
src="https://cdn.ampproject.org/v0/amp-install-serviceworker-0.1.js"></script>

</head>
<body>
<amp-install-serviceworker
src="ngsw-worker.js"
layout="nodisplay">
</amp-install-serviceworker>
<div id="content-wrapper">
<app-root></app-root>
</div>
Expand Down

0 comments on commit fcdab0c

Please sign in to comment.