diff --git a/src/app/main/content/components/angular-material/example-components.ts b/src/app/main/content/components/angular-material/example-components.ts
index a8065211..10a136dc 100644
--- a/src/app/main/content/components/angular-material/example-components.ts
+++ b/src/app/main/content/components/angular-material/example-components.ts
@@ -26,6 +26,13 @@ import { DialogElementsExampleDialog, DialogElementsExample } from '../../../../
import { DialogOverviewExampleDialog, DialogOverviewExample } from '../../../../../assets/angular-material-examples/dialog-overview/dialog-overview-example';
import { ExpansionOverviewExample } from '../../../../../assets/angular-material-examples/expansion-overview/expansion-overview-example';
import { ExpansionStepsExample } from '../../../../../assets/angular-material-examples/expansion-steps/expansion-steps-example';
+import { MyTelInput, FormFieldCustomControlExample } from '../../../../../assets/angular-material-examples/form-field-custom-control/form-field-custom-control-example';
+import { FormFieldErrorExample } from '../../../../../assets/angular-material-examples/form-field-error/form-field-error-example';
+import { FormFieldHintExample } from '../../../../../assets/angular-material-examples/form-field-hint/form-field-hint-example';
+import { FormFieldOverviewExample } from '../../../../../assets/angular-material-examples/form-field-overview/form-field-overview-example';
+import { FormFieldPlaceholderExample } from '../../../../../assets/angular-material-examples/form-field-placeholder/form-field-placeholder-example';
+import { FormFieldPrefixSuffixExample } from '../../../../../assets/angular-material-examples/form-field-prefix-suffix/form-field-prefix-suffix-example';
+import { FormFieldThemingExample } from '../../../../../assets/angular-material-examples/form-field-theming/form-field-theming-example';
import { GridListDynamicExample } from '../../../../../assets/angular-material-examples/grid-list-dynamic/grid-list-dynamic-example';
import { GridListOverviewExample } from '../../../../../assets/angular-material-examples/grid-list-overview/grid-list-overview-example';
import { IconOverviewExample } from '../../../../../assets/angular-material-examples/icon-overview/icon-overview-example';
@@ -95,6 +102,15 @@ export const COMPONENT_MAP = {
'datepicker-touch',
'datepicker-api'
],
+ 'form-field' : [
+ 'form-field-overview',
+ 'form-field-placeholder',
+ 'form-field-hint',
+ 'form-field-error',
+ 'form-field-prefix-suffix',
+ 'form-field-theming',
+ 'form-field-custom-control'
+ ],
'input' : [
'input-overview',
'input-errors',
@@ -167,7 +183,8 @@ export const COMPONENT_MAP = {
],
'chips' : [
'chips-overview',
- 'chips-input'
+ 'chips-input',
+ 'chips-stacked'
],
'icon' : [
'icon-overview',
@@ -378,6 +395,48 @@ export const EXAMPLE_COMPONENTS = {
additionalFiles: null,
selectorName : null
},
+ 'form-field-custom-control' : {
+ title : 'Form field with custom telephone number input control. ',
+ component : FormFieldCustomControlExample,
+ additionalFiles: ['form-field-custom-control-example.html'],
+ selectorName : 'FormFieldCustomControlExample, MyTelInput'
+ },
+ 'form-field-error' : {
+ title : 'Form field with error messages ',
+ component : FormFieldErrorExample,
+ additionalFiles: null,
+ selectorName : null
+ },
+ 'form-field-hint' : {
+ title : 'Form field with hints ',
+ component : FormFieldHintExample,
+ additionalFiles: null,
+ selectorName : null
+ },
+ 'form-field-overview' : {
+ title : 'Simple form field ',
+ component : FormFieldOverviewExample,
+ additionalFiles: null,
+ selectorName : null
+ },
+ 'form-field-placeholder' : {
+ title : 'Form field with placeholder ',
+ component : FormFieldPlaceholderExample,
+ additionalFiles: null,
+ selectorName : null
+ },
+ 'form-field-prefix-suffix' : {
+ title : 'Form field with prefix & suffix ',
+ component : FormFieldPrefixSuffixExample,
+ additionalFiles: null,
+ selectorName : null
+ },
+ 'form-field-theming' : {
+ title : 'Form field theming ',
+ component : FormFieldThemingExample,
+ additionalFiles: null,
+ selectorName : null
+ },
'grid-list-dynamic' : {
title : 'Dynamic grid-list',
component : GridListDynamicExample,
@@ -707,6 +766,13 @@ export const EXAMPLE_LIST = [
DialogOverviewExample,
ExpansionOverviewExample,
ExpansionStepsExample,
+ MyTelInput, FormFieldCustomControlExample,
+ FormFieldErrorExample,
+ FormFieldHintExample,
+ FormFieldOverviewExample,
+ FormFieldPlaceholderExample,
+ FormFieldPrefixSuffixExample,
+ FormFieldThemingExample,
GridListDynamicExample,
GridListOverviewExample,
IconOverviewExample,
diff --git a/src/app/navigation.model.ts b/src/app/navigation.model.ts
index 43ca80fc..044f2d59 100644
--- a/src/app/navigation.model.ts
+++ b/src/app/navigation.model.ts
@@ -377,6 +377,11 @@ export class NavigationModel
'type' : 'item',
'url' : '/components/angular-material/datepicker'
},
+ {
+ 'title': 'Form field',
+ 'type' : 'item',
+ 'url' : '/components/angular-material/form-field'
+ },
{
'title': 'Input',
'type' : 'item',
diff --git a/src/assets/angular-material-examples/chips-input/chips-input-example.html b/src/assets/angular-material-examples/chips-input/chips-input-example.html
index dd8eef89..d29d8eac 100644
--- a/src/assets/angular-material-examples/chips-input/chips-input-example.html
+++ b/src/assets/angular-material-examples/chips-input/chips-input-example.html
@@ -1,14 +1,14 @@
-
+
{{fruit.name}}
cancel
+
-
diff --git a/src/assets/angular-material-examples/chips-stacked/chips-stacked-example.html b/src/assets/angular-material-examples/chips-stacked/chips-stacked-example.html
index e662f6cd..29de296b 100644
--- a/src/assets/angular-material-examples/chips-stacked/chips-stacked-example.html
+++ b/src/assets/angular-material-examples/chips-stacked/chips-stacked-example.html
@@ -1,7 +1,5 @@
-
- {{chipColor.name}}
+
+ {{chip.name}}
diff --git a/src/assets/angular-material-examples/dialog-content/dialog-content-example-dialog.html b/src/assets/angular-material-examples/dialog-content/dialog-content-example-dialog.html
index 927fdfde..2f6cf391 100644
--- a/src/assets/angular-material-examples/dialog-content/dialog-content-example-dialog.html
+++ b/src/assets/angular-material-examples/dialog-content/dialog-content-example-dialog.html
@@ -1,4 +1,4 @@
-
Install Angular
+Install Angular
DEVELOP ACROSS ALL PLATFORMS
Learn one way to build applications with Angular and reuse your code and abilities to build
@@ -20,6 +20,6 @@
that supports Google's largest applications.
- Install
- Cancel
+ Install
+ Cancel
diff --git a/src/assets/angular-material-examples/dialog-data/dialog-data-example-dialog.html b/src/assets/angular-material-examples/dialog-data/dialog-data-example-dialog.html
index cc651524..d14317a8 100644
--- a/src/assets/angular-material-examples/dialog-data/dialog-data-example-dialog.html
+++ b/src/assets/angular-material-examples/dialog-data/dialog-data-example-dialog.html
@@ -1,4 +1,4 @@
-Favorite Animal
+Favorite Animal
My favorite animal is:
diff --git a/src/assets/angular-material-examples/dialog-elements/dialog-elements-example-dialog.html b/src/assets/angular-material-examples/dialog-elements/dialog-elements-example-dialog.html
index eba6236a..fa3d20c4 100644
--- a/src/assets/angular-material-examples/dialog-elements/dialog-elements-example-dialog.html
+++ b/src/assets/angular-material-examples/dialog-elements/dialog-elements-example-dialog.html
@@ -1,5 +1,5 @@
-Dialog with elements
+Dialog with elements
This dialog showcases the title, close, content and actions elements.
- Close
+ Close
diff --git a/src/assets/angular-material-examples/dialog-overview/dialog-overview-example-dialog.html b/src/assets/angular-material-examples/dialog-overview/dialog-overview-example-dialog.html
index b96d1b11..1b77f60e 100644
--- a/src/assets/angular-material-examples/dialog-overview/dialog-overview-example-dialog.html
+++ b/src/assets/angular-material-examples/dialog-overview/dialog-overview-example-dialog.html
@@ -1,4 +1,4 @@
-Hi {{data.name}}
+Hi {{data.name}}
What's your favorite animal?
@@ -6,6 +6,6 @@
- Ok
+ Ok
No Thanks
diff --git a/src/assets/angular-material-examples/form-field-custom-control/form-field-custom-control-example.css b/src/assets/angular-material-examples/form-field-custom-control/form-field-custom-control-example.css
new file mode 100644
index 00000000..515dd7c1
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-custom-control/form-field-custom-control-example.css
@@ -0,0 +1,21 @@
+div {
+ display: flex;
+}
+
+input {
+ border: none;
+ background: none;
+ padding: 0;
+ outline: none;
+ font: inherit;
+ text-align: center;
+}
+
+span {
+ opacity: 0;
+ transition: opacity 200ms;
+}
+
+:host.floating span {
+ opacity: 1;
+}
diff --git a/src/assets/angular-material-examples/form-field-custom-control/form-field-custom-control-example.html b/src/assets/angular-material-examples/form-field-custom-control/form-field-custom-control-example.html
new file mode 100644
index 00000000..74a64b9c
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-custom-control/form-field-custom-control-example.html
@@ -0,0 +1,7 @@
+
+
+ –
+
+ –
+
+
diff --git a/src/assets/angular-material-examples/form-field-custom-control/form-field-custom-control-example.ts b/src/assets/angular-material-examples/form-field-custom-control/form-field-custom-control-example.ts
new file mode 100644
index 00000000..e9e62c24
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-custom-control/form-field-custom-control-example.ts
@@ -0,0 +1,177 @@
+import { FocusMonitor } from '@angular/cdk/a11y';
+import { coerceBooleanProperty } from '@angular/cdk/coercion';
+import { Component, ElementRef, Input, OnDestroy, Renderer2 } from '@angular/core';
+import { FormBuilder, FormGroup } from '@angular/forms';
+import { MatFormFieldControl } from '@angular/material/form-field';
+import { Subject } from 'rxjs/Subject';
+
+/** Data structure for holding telephone number. */
+export class MyTel
+{
+ constructor(public area: string, public exchange: string, public subscriber: string)
+ {
+ }
+}
+
+/** Custom `MatFormFieldControl` for telephone number input. */
+@Component({
+ selector : 'my-tel-input',
+ templateUrl: 'form-field-custom-control-example.html',
+ styleUrls : ['form-field-custom-control-example.css'],
+ providers : [
+ {
+ provide : MatFormFieldControl,
+ useExisting: MyTelInput
+ }
+ ],
+ host : {
+ '[class.floating]' : 'shouldPlaceholderFloat',
+ '[id]' : 'id',
+ '[attr.aria-describedby]': 'describedBy'
+ }
+})
+export class MyTelInput implements MatFormFieldControl, OnDestroy
+{
+ static nextId = 0;
+
+ parts: FormGroup;
+
+ stateChanges = new Subject();
+
+ focused = false;
+
+ ngControl = null;
+
+ errorState = false;
+
+ controlType = 'my-tel-input';
+
+ get empty()
+ {
+ let n = this.parts.value;
+ return !n.area && !n.exchange && !n.subscriber;
+ }
+
+ get shouldPlaceholderFloat()
+ {
+ return this.focused || !this.empty;
+ }
+
+ id = `my-tel-input-${MyTelInput.nextId++}`;
+
+ describedBy = '';
+
+ @Input()
+ get placeholder()
+ {
+ return this._placeholder;
+ }
+
+ set placeholder(plh)
+ {
+ this._placeholder = plh;
+ this.stateChanges.next();
+ }
+
+ private _placeholder: string;
+
+ @Input()
+ get required()
+ {
+ return this._required;
+ }
+
+ set required(req)
+ {
+ this._required = coerceBooleanProperty(req);
+ this.stateChanges.next();
+ }
+
+ private _required = false;
+
+ @Input()
+ get disabled()
+ {
+ return this._disabled;
+ }
+
+ set disabled(dis)
+ {
+ this._disabled = coerceBooleanProperty(dis);
+ this.stateChanges.next();
+ }
+
+ private _disabled = false;
+
+ @Input()
+ get value(): MyTel | null
+ {
+ let n = this.parts.value;
+ if ( n.area.length == 3 && n.exchange.length == 3 && n.subscriber.length == 4 )
+ {
+ return new MyTel(n.area, n.exchange, n.subscriber);
+ }
+ return null;
+ }
+
+ set value(tel: MyTel | null)
+ {
+ tel = tel || new MyTel('', '', '');
+ this.parts.setValue({
+ area : tel.area,
+ exchange : tel.exchange,
+ subscriber: tel.subscriber
+ });
+ this.stateChanges.next();
+ }
+
+ constructor(fb: FormBuilder, private fm: FocusMonitor, private elRef: ElementRef,
+ renderer: Renderer2
+ )
+ {
+ this.parts = fb.group({
+ 'area' : '',
+ 'exchange' : '',
+ 'subscriber': ''
+ });
+
+ fm.monitor(elRef.nativeElement, renderer, true).subscribe((origin) => {
+ this.focused = !!origin;
+ this.stateChanges.next();
+ });
+ }
+
+ ngOnDestroy()
+ {
+ this.stateChanges.complete();
+ this.fm.stopMonitoring(this.elRef.nativeElement);
+ }
+
+ setDescribedByIds(ids: string[])
+ {
+ this.describedBy = ids.join(' ');
+ }
+
+ onContainerClick(event: MouseEvent)
+ {
+ if ( (event.target as Element).tagName.toLowerCase() != 'input' )
+ {
+ this.elRef.nativeElement.querySelector('input').focus();
+ }
+ }
+}
+
+/** @title Form field with custom telephone number input control. */
+@Component({
+ selector: 'form-field-custom-control-example',
+ template: `
+
+
+ phone
+ Include area code
+
+ `
+})
+export class FormFieldCustomControlExample
+{
+}
diff --git a/src/assets/angular-material-examples/form-field-error/form-field-error-example.css b/src/assets/angular-material-examples/form-field-error/form-field-error-example.css
new file mode 100644
index 00000000..6efed507
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-error/form-field-error-example.css
@@ -0,0 +1,8 @@
+.example-container {
+ display: flex;
+ flex-direction: column;
+}
+
+.example-container > * {
+ width: 100%;
+}
diff --git a/src/assets/angular-material-examples/form-field-error/form-field-error-example.html b/src/assets/angular-material-examples/form-field-error/form-field-error-example.html
new file mode 100644
index 00000000..4a626d54
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-error/form-field-error-example.html
@@ -0,0 +1,6 @@
+
+
+
+ {{getErrorMessage()}}
+
+
diff --git a/src/assets/angular-material-examples/form-field-error/form-field-error-example.ts b/src/assets/angular-material-examples/form-field-error/form-field-error-example.ts
new file mode 100644
index 00000000..ad13e53b
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-error/form-field-error-example.ts
@@ -0,0 +1,20 @@
+import { Component } from '@angular/core';
+import { FormControl, Validators } from '@angular/forms';
+
+/** @title Form field with error messages */
+@Component({
+ selector : 'form-field-error-example',
+ templateUrl: 'form-field-error-example.html',
+ styleUrls : ['form-field-error-example.css']
+})
+export class FormFieldErrorExample
+{
+ email = new FormControl('', [Validators.required, Validators.email]);
+
+ getErrorMessage()
+ {
+ return this.email.hasError('required') ? 'You must enter a value' :
+ this.email.hasError('email') ? 'Not a valid email' :
+ '';
+ }
+}
diff --git a/src/assets/angular-material-examples/form-field-hint/form-field-hint-example.css b/src/assets/angular-material-examples/form-field-hint/form-field-hint-example.css
new file mode 100644
index 00000000..6efed507
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-hint/form-field-hint-example.css
@@ -0,0 +1,8 @@
+.example-container {
+ display: flex;
+ flex-direction: column;
+}
+
+.example-container > * {
+ width: 100%;
+}
diff --git a/src/assets/angular-material-examples/form-field-hint/form-field-hint-example.html b/src/assets/angular-material-examples/form-field-hint/form-field-hint-example.html
new file mode 100644
index 00000000..fb09e073
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-hint/form-field-hint-example.html
@@ -0,0 +1,13 @@
+
+
+
+ {{input.value?.length || 0}}/10
+
+
+
+
+ Option
+
+ Here's the dropdown arrow ^
+
+
diff --git a/src/assets/angular-material-examples/form-field-hint/form-field-hint-example.ts b/src/assets/angular-material-examples/form-field-hint/form-field-hint-example.ts
new file mode 100644
index 00000000..556928ca
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-hint/form-field-hint-example.ts
@@ -0,0 +1,11 @@
+import { Component } from '@angular/core';
+
+/** @title Form field with hints */
+@Component({
+ selector : 'form-field-hint-example',
+ templateUrl: 'form-field-hint-example.html',
+ styleUrls : ['form-field-hint-example.css']
+})
+export class FormFieldHintExample
+{
+}
diff --git a/src/assets/angular-material-examples/form-field-overview/form-field-overview-example.css b/src/assets/angular-material-examples/form-field-overview/form-field-overview-example.css
new file mode 100644
index 00000000..6efed507
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-overview/form-field-overview-example.css
@@ -0,0 +1,8 @@
+.example-container {
+ display: flex;
+ flex-direction: column;
+}
+
+.example-container > * {
+ width: 100%;
+}
diff --git a/src/assets/angular-material-examples/form-field-overview/form-field-overview-example.html b/src/assets/angular-material-examples/form-field-overview/form-field-overview-example.html
new file mode 100644
index 00000000..8c19a60e
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-overview/form-field-overview-example.html
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+ Option
+
+
+
diff --git a/src/assets/angular-material-examples/form-field-overview/form-field-overview-example.ts b/src/assets/angular-material-examples/form-field-overview/form-field-overview-example.ts
new file mode 100644
index 00000000..cd18e2ef
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-overview/form-field-overview-example.ts
@@ -0,0 +1,11 @@
+import { Component } from '@angular/core';
+
+/** @title Simple form field */
+@Component({
+ selector : 'form-field-overview-example',
+ templateUrl: 'form-field-overview-example.html',
+ styleUrls : ['form-field-overview-example.css']
+})
+export class FormFieldOverviewExample
+{
+}
diff --git a/src/assets/angular-material-examples/form-field-placeholder/form-field-placeholder-example.css b/src/assets/angular-material-examples/form-field-placeholder/form-field-placeholder-example.css
new file mode 100644
index 00000000..4118084a
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-placeholder/form-field-placeholder-example.css
@@ -0,0 +1,20 @@
+.example-container {
+ display: flex;
+ flex-direction: column;
+}
+
+.example-container > * {
+ width: 100%;
+}
+
+.example-container form {
+ margin-bottom: 20px;
+}
+
+.example-container form > * {
+ margin: 5px 0;
+}
+
+.example-container .mat-radio-button {
+ margin: 0 5px;
+}
diff --git a/src/assets/angular-material-examples/form-field-placeholder/form-field-placeholder-example.html b/src/assets/angular-material-examples/form-field-placeholder/form-field-placeholder-example.html
new file mode 100644
index 00000000..384e461c
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-placeholder/form-field-placeholder-example.html
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+ -- None --
+ Option
+
+
+ favorite
+ Fancy placeholder
+
+
diff --git a/src/assets/angular-material-examples/form-field-placeholder/form-field-placeholder-example.ts b/src/assets/angular-material-examples/form-field-placeholder/form-field-placeholder-example.ts
new file mode 100644
index 00000000..92fb35c5
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-placeholder/form-field-placeholder-example.ts
@@ -0,0 +1,21 @@
+import { Component } from '@angular/core';
+import { FormBuilder, FormGroup } from '@angular/forms';
+
+/** @title Form field with placeholder */
+@Component({
+ selector : 'form-field-placeholder-example',
+ templateUrl: 'form-field-placeholder-example.html',
+ styleUrls : ['form-field-placeholder-example.css']
+})
+export class FormFieldPlaceholderExample
+{
+ options: FormGroup;
+
+ constructor(fb: FormBuilder)
+ {
+ this.options = fb.group({
+ hideRequired : false,
+ floatPlaceholder: 'auto'
+ });
+ }
+}
diff --git a/src/assets/angular-material-examples/form-field-prefix-suffix/form-field-prefix-suffix-example.css b/src/assets/angular-material-examples/form-field-prefix-suffix/form-field-prefix-suffix-example.css
new file mode 100644
index 00000000..553ce85f
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-prefix-suffix/form-field-prefix-suffix-example.css
@@ -0,0 +1,17 @@
+.example-container {
+ display: flex;
+ flex-direction: column;
+}
+
+.example-container > * {
+ width: 100%;
+}
+
+.example-right-align {
+ text-align: right;
+}
+
+input.example-right-align::-webkit-outer-spin-button,
+input.example-right-align::-webkit-inner-spin-button {
+ display: none;
+}
diff --git a/src/assets/angular-material-examples/form-field-prefix-suffix/form-field-prefix-suffix-example.html b/src/assets/angular-material-examples/form-field-prefix-suffix/form-field-prefix-suffix-example.html
new file mode 100644
index 00000000..a761065b
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-prefix-suffix/form-field-prefix-suffix-example.html
@@ -0,0 +1,12 @@
+
+
+
+ {{hide ? 'visibility' : 'visibility_off'}}
+
+
+
+
+ $
+ .00
+
+
diff --git a/src/assets/angular-material-examples/form-field-prefix-suffix/form-field-prefix-suffix-example.ts b/src/assets/angular-material-examples/form-field-prefix-suffix/form-field-prefix-suffix-example.ts
new file mode 100644
index 00000000..279ed320
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-prefix-suffix/form-field-prefix-suffix-example.ts
@@ -0,0 +1,12 @@
+import { Component } from '@angular/core';
+
+/** @title Form field with prefix & suffix */
+@Component({
+ selector : 'form-field-prefix-suffix-example',
+ templateUrl: 'form-field-prefix-suffix-example.html',
+ styleUrls : ['form-field-prefix-suffix-example.css']
+})
+export class FormFieldPrefixSuffixExample
+{
+ hide = true;
+}
diff --git a/src/assets/angular-material-examples/form-field-theming/form-field-theming-example.css b/src/assets/angular-material-examples/form-field-theming/form-field-theming-example.css
new file mode 100644
index 00000000..6efed507
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-theming/form-field-theming-example.css
@@ -0,0 +1,8 @@
+.example-container {
+ display: flex;
+ flex-direction: column;
+}
+
+.example-container > * {
+ width: 100%;
+}
diff --git a/src/assets/angular-material-examples/form-field-theming/form-field-theming-example.html b/src/assets/angular-material-examples/form-field-theming/form-field-theming-example.html
new file mode 100644
index 00000000..085adc53
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-theming/form-field-theming-example.html
@@ -0,0 +1,14 @@
+
diff --git a/src/assets/angular-material-examples/form-field-theming/form-field-theming-example.ts b/src/assets/angular-material-examples/form-field-theming/form-field-theming-example.ts
new file mode 100644
index 00000000..a417d1fa
--- /dev/null
+++ b/src/assets/angular-material-examples/form-field-theming/form-field-theming-example.ts
@@ -0,0 +1,26 @@
+import { Component } from '@angular/core';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+
+/** @title Form field theming */
+@Component({
+ selector : 'form-field-theming-example',
+ templateUrl: 'form-field-theming-example.html',
+ styleUrls : ['form-field-theming-example.css']
+})
+export class FormFieldThemingExample
+{
+ options: FormGroup;
+
+ constructor(fb: FormBuilder)
+ {
+ this.options = fb.group({
+ 'color' : 'primary',
+ 'fontSize': [16, Validators.min(10)]
+ });
+ }
+
+ getFontSize()
+ {
+ return Math.max(10, this.options.value.fontSize);
+ }
+}
diff --git a/src/assets/angular-material-examples/list-sections/list-sections-example.html b/src/assets/angular-material-examples/list-sections/list-sections-example.html
index 10d6b892..eb291d09 100644
--- a/src/assets/angular-material-examples/list-sections/list-sections-example.html
+++ b/src/assets/angular-material-examples/list-sections/list-sections-example.html
@@ -1,15 +1,15 @@
- Folders
+ Folders
folder
- {{folder.name}}
- {{folder.updated | date}}
+ {{folder.name}}
+ {{folder.updated | date}}
- Notes
+ Notes
note
- {{note.name}}
- {{note.updated | date}}
+ {{note.name}}
+ {{note.updated | date}}
diff --git a/src/assets/angular-material-examples/paginator-configurable/paginator-configurable-example.ts b/src/assets/angular-material-examples/paginator-configurable/paginator-configurable-example.ts
index 8a63b15e..18410263 100644
--- a/src/assets/angular-material-examples/paginator-configurable/paginator-configurable-example.ts
+++ b/src/assets/angular-material-examples/paginator-configurable/paginator-configurable-example.ts
@@ -10,12 +10,12 @@ import { PageEvent } from '@angular/material';
})
export class PaginatorConfigurableExample
{
- // MdPaginator Inputs
+ // MatPaginator Inputs
length = 100;
pageSize = 10;
pageSizeOptions = [5, 10, 25, 100];
- // MdPaginator Output
+ // MatPaginator Output
pageEvent: PageEvent;
setPageSizeOptions(setPageSizeOptionsInput: string)
diff --git a/src/assets/angular-material-examples/radio-overview/radio-overview-example.css b/src/assets/angular-material-examples/radio-overview/radio-overview-example.css
index 74323087..02321253 100644
--- a/src/assets/angular-material-examples/radio-overview/radio-overview-example.css
+++ b/src/assets/angular-material-examples/radio-overview/radio-overview-example.css
@@ -1 +1,3 @@
-/** No CSS for this example */
+.mat-radio-button ~ .mat-radio-button {
+ padding-right: 16px;
+}
diff --git a/src/assets/angular-material-examples/radio-overview/radio-overview-example.ts b/src/assets/angular-material-examples/radio-overview/radio-overview-example.ts
index aab6e208..407edd69 100644
--- a/src/assets/angular-material-examples/radio-overview/radio-overview-example.ts
+++ b/src/assets/angular-material-examples/radio-overview/radio-overview-example.ts
@@ -5,7 +5,8 @@ import { Component } from '@angular/core';
*/
@Component({
selector : 'radio-overview-example',
- templateUrl: 'radio-overview-example.html'
+ templateUrl: 'radio-overview-example.html',
+ styleUrls : ['radio-overview-example.css']
})
export class RadioOverviewExample
{
diff --git a/src/assets/angular-material-examples/select-form/select-form-example.html b/src/assets/angular-material-examples/select-form/select-form-example.html
index 94157c4d..e74faf8a 100644
--- a/src/assets/angular-material-examples/select-form/select-form-example.html
+++ b/src/assets/angular-material-examples/select-form/select-form-example.html
@@ -1,9 +1,11 @@
diff --git a/src/assets/angular-material-examples/select-overview/select-overview-example.html b/src/assets/angular-material-examples/select-overview/select-overview-example.html
index 47e5467f..522d60ba 100644
--- a/src/assets/angular-material-examples/select-overview/select-overview-example.html
+++ b/src/assets/angular-material-examples/select-overview/select-overview-example.html
@@ -1,5 +1,7 @@
-
-
- {{ food.viewValue }}
-
-
+
+
+
+ {{ food.viewValue }}
+
+
+
diff --git a/src/assets/angular-material-examples/snack-bar-component/snack-bar-component-example-snack.css b/src/assets/angular-material-examples/snack-bar-component/snack-bar-component-example-snack.css
deleted file mode 100644
index b8499867..00000000
--- a/src/assets/angular-material-examples/snack-bar-component/snack-bar-component-example-snack.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.example-pizza-party {
- color: hotpink;
-}
diff --git a/src/assets/angular-material-examples/snack-bar-component/snack-bar-component-example.ts b/src/assets/angular-material-examples/snack-bar-component/snack-bar-component-example.ts
index 5edd96bb..52541090 100644
--- a/src/assets/angular-material-examples/snack-bar-component/snack-bar-component-example.ts
+++ b/src/assets/angular-material-examples/snack-bar-component/snack-bar-component-example.ts
@@ -25,7 +25,7 @@ export class SnackBarComponentExample
@Component({
selector : 'snack-bar-component-example-snack',
templateUrl: 'snack-bar-component-example-snack.html',
- styleUrls : ['snack-bar-component-example-snack.css']
+ styles : [`.example-pizza-party { color: hotpink; }`]
})
export class PizzaPartyComponent
{
diff --git a/src/assets/angular-material-examples/table-http/table-http-example.ts b/src/assets/angular-material-examples/table-http/table-http-example.ts
index 2ec83819..a6848596 100644
--- a/src/assets/angular-material-examples/table-http/table-http-example.ts
+++ b/src/assets/angular-material-examples/table-http/table-http-example.ts
@@ -109,7 +109,7 @@ export class ExampleDataSource extends DataSource
.startWith(null)
.switchMap(() => {
setTimeout(() => {
- this.isLoadingResults = true;
+ this.isLoadingResults = true;
});
return this.exampleDatabase.getRepoIssues(
this.sort.active, this.sort.direction, this.paginator.pageIndex);
@@ -125,8 +125,8 @@ export class ExampleDataSource extends DataSource
.catch(() => {
// Catch if the GitHub API has reached its rate limit. Return empty data.
setTimeout(() => {
- this.isLoadingResults = false;
- this.isRateLimitReached = true;
+ this.isLoadingResults = false;
+ this.isRateLimitReached = true;
});
return Observable.of([]);
});
diff --git a/src/assets/angular-material-examples/table-overview/table-overview-example.ts b/src/assets/angular-material-examples/table-overview/table-overview-example.ts
index 07e35531..c70bbd8b 100644
--- a/src/assets/angular-material-examples/table-overview/table-overview-example.ts
+++ b/src/assets/angular-material-examples/table-overview/table-overview-example.ts
@@ -122,10 +122,10 @@ export class ExampleDatabase
{
// Fill up the database with 100 users.
setTimeout(() => {
- for ( let i = 0; i < 100; i++ )
- {
- this.addUser();
- }
+ for ( let i = 0; i < 100; i++ )
+ {
+ this.addUser();
+ }
});
}
diff --git a/src/assets/angular-material-examples/tooltip-position/tooltip-position-example.html b/src/assets/angular-material-examples/tooltip-position/tooltip-position-example.html
index 803223af..4b1ee9ae 100644
--- a/src/assets/angular-material-examples/tooltip-position/tooltip-position-example.html
+++ b/src/assets/angular-material-examples/tooltip-position/tooltip-position-example.html
@@ -1,11 +1,13 @@
Show tooltip
-
- Before
- After
- Above
- Below
- Left
- Right
-
+
+
+ Before
+ After
+ Above
+ Below
+ Left
+ Right
+
+