Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 0b820f7

Browse files
committed
docs(cb-a11y): Building examples - Form controls
1 parent d74b906 commit 0b820f7

File tree

7 files changed

+39
-35
lines changed

7 files changed

+39
-35
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
label {
2+
color: #424242;
3+
}
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<fieldset class="form-group row">
2-
<div class="col-xs-12">
3-
<legend><ng-content></ng-content></legend>
4-
<div *ngFor="#checkbox of checkboxModel" class="checkbox col-xs-12">
5-
<label>
6-
<input type="checkbox" [value]="checkbox.value" [name]="checkboxName">
7-
{{checkbox.name}}
8-
</label>
9-
</div>
2+
<legend class="col-xs-12">
3+
<ng-content></ng-content>
4+
</legend>
5+
<div *ngFor="#checkbox of checkboxModel" class="checkbox col-xs-12">
6+
<label>
7+
<input type="checkbox" [value]="checkbox.value" [name]="checkboxName">
8+
{{checkbox.name}}
9+
</label>
1010
</div>
1111
</fieldset>

public/docs/_examples/cb-a11y/ts/app/a11y-form-controls.component.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
<form #accessibleForm="ngForm"
2-
(ngSubmit)="submit(accessibleForm.value)">
1+
<form>
32

4-
<a11y-input>Label for input:</a11y-input>
3+
<a11y-input>Type something:</a11y-input>
54

65

76
<div class="form-group">
@@ -91,6 +90,4 @@
9190
Label for input:
9291
</a11y-input-explicit>
9392

94-
<button class="btn btn-primary" type="submit">Submit</button>
95-
9693
</form>

public/docs/_examples/cb-a11y/ts/app/a11y-form-controls.component.ts

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,29 @@ import {A11ySelect} from "./a11y-select.component";
1010
@Component({
1111
selector: 'a11y-form-controls',
1212
templateUrl: './app/a11y-form-controls.component.html',
13-
directives: [CORE_DIRECTIVES, FORM_DIRECTIVES, A11yInput, A11yInputExplicit,
14-
A11yCheckboxes, A11yRadiobuttons, A11ySelect]
13+
directives: [
14+
CORE_DIRECTIVES,
15+
FORM_DIRECTIVES,
16+
A11yInput,
17+
A11yInputExplicit,
18+
A11yCheckboxes,
19+
A11yRadiobuttons,
20+
A11ySelect
21+
]
1522
})
16-
export class A11yFormControls implements OnInit{
23+
export class A11yFormControls implements OnInit {
1724

18-
checkBoxes: any;
19-
radioButtons: any;
20-
selectOptions: any;
25+
checkBoxes:any;
26+
radioButtons:any;
27+
selectOptions:any;
2128

22-
constructor(private _a11yHelper: A11yHelper){
29+
constructor(private _a11yHelper:A11yHelper) {
2330
}
2431

25-
ngOnInit(){
32+
ngOnInit() {
2633
this.checkBoxes = this._a11yHelper.getCheckboxModel();
2734
this.radioButtons = this._a11yHelper.getRadiobuttonsModel();
2835
this.selectOptions = this._a11yHelper.getSelectOptions();
2936
}
3037

31-
submit(formValue: any):void{
32-
console.log(formValue)
33-
34-
}
3538
}
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<fieldset class="form-group row">
2-
<div class="col-xs-12">
3-
<legend><ng-content></ng-content></legend>
4-
<div *ngFor="#radiobutton of radiobuttonModel" class="radio col-xs-12">
5-
<label>
6-
<input type="radio" [value]="radiobutton.value" [name]="radiobuttonName">
7-
{{radiobutton.name}}
8-
</label>
9-
</div>
2+
<legend class="col-xs-12">
3+
<ng-content></ng-content>
4+
</legend>
5+
<div *ngFor="#radiobutton of radiobuttonModel" class="radio col-xs-12">
6+
<label>
7+
<input type="radio" [value]="radiobutton.value" [name]="radiobuttonName">
8+
{{radiobutton.name}}
9+
</label>
1010
</div>
1111
</fieldset>

public/docs/_examples/cb-a11y/ts/app/app.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="container">
1+
<div class="container well">
22
<h1 id="top">A11y Cookbook </h1>
33

44
<a11y-form-controls></a11y-form-controls>

public/docs/_examples/cb-a11y/ts/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33
<head>
44
<title>A11y demonstration</title>
55

@@ -8,6 +8,7 @@
88
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
99
<!-- #enddocregion bootstrap -->
1010
<link rel="stylesheet" href="styles.css">
11+
<link rel="stylesheet" href="a11y.css">
1112

1213
<!-- IE required polyfills, in this exact order -->
1314
<script src="node_modules/es6-shim/es6-shim.min.js"></script>

0 commit comments

Comments
 (0)