Skip to content

Commit 1efd1b0

Browse files
Merge pull request samvloeberghs#27 from samvloeberghs/stylecleanup
Stylecleanup
2 parents 377af4c + e28fedb commit 1efd1b0

26 files changed

+141
-140
lines changed
File renamed without changes.
File renamed without changes.

src/app/app.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import { AppState } from './app.service';
77
* Top Level Component
88
*/
99
@Component({
10-
selector: 'app',
10+
selector: 'sv-app',
1111
providers: [],
12-
styles: [require('./app.scss')],
13-
template: require('./app.html'),
12+
styles: [require('./app.component.scss')],
13+
template: require('./app.component.html'),
1414
encapsulation: ViewEncapsulation.None
1515
})
1616

src/app/app.module.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
import { NgModule } from "@angular/core";
2-
import { BrowserModule } from "@angular/platform-browser";
3-
import { RouterModule } from "@angular/router";
4-
import { HttpModule } from "@angular/http";
5-
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
1+
import { NgModule } from '@angular/core';
2+
import { BrowserModule } from '@angular/platform-browser';
3+
import { RouterModule } from '@angular/router';
4+
import { HttpModule } from '@angular/http';
5+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
66

7-
import { AppComponent } from "./app.component";
8-
import { AppState } from "./app.service";
9-
import { ROUTES } from "./app.routes";
10-
import { Login } from "./login/login.component";
11-
import { Register } from "./register/register.component";
12-
import { SetNewPassword } from "./set-new-password/setNewPassword.component";
13-
import { ForgotPassword } from "./forgot-password/forgotPassword.component";
7+
import { AppComponent, ROUTES, AppState } from './';
8+
import { Login } from './login';
9+
import { Register } from './register';
10+
import { SetNewPassword } from './set-new-password';
11+
import { ForgotPassword } from './forgot-password';
1412

1513
const APP_PROVIDERS = [
1614
AppState

src/app/app.routes.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Routes } from '@angular/router';
22

3-
import { Login } from "./login/login.component";
4-
import { Register } from "./register/register.component";
5-
import { ForgotPassword } from "./forgot-password/forgotPassword.component";
6-
import { SetNewPassword } from "./set-new-password/setNewPassword.component";
3+
import { Login } from './login';
4+
import { Register } from './register';
5+
import { ForgotPassword } from './forgot-password';
6+
import { SetNewPassword } from './set-new-password';
77

88
export const ROUTES: Routes = [
99
{path: '', component: Login},

src/app/app.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import { HmrState } from 'angular2-hmr';
44
@Injectable()
55
export class AppState {
66
// HmrState uis used by HMR to track the any state during reloading
7-
@HmrState() _state = {};
7+
@HmrState() state = {};
88

99
constructor() {
1010

1111
}
1212

1313
// already return a clone of the current state
1414
get state() {
15-
return this._state = this._clone(this._state);
15+
return this.state = this.clone(this.state);
1616
}
1717

1818
// never allow mutation
@@ -29,11 +29,11 @@ export class AppState {
2929

3030
set(prop: string, value: any) {
3131
// internally mutate our state
32-
return this._state[prop] = value;
32+
return this.state[prop] = value;
3333
}
3434

3535

36-
_clone(object) {
36+
clone(object) {
3737
// simple object clone
3838
return JSON.parse(JSON.stringify(object));
3939
}

src/app/email-validator/email.validator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FormControl } from "@angular/forms";
1+
import { FormControl } from '@angular/forms';
22

33
interface EmailValidatorFn {
44
[key: string]: boolean;
@@ -8,7 +8,7 @@ export class EmailValidator {
88
static validEmail(control: FormControl): EmailValidatorFn {
99
let value = control.value;
1010
/* tslint:disable */
11-
const EMAIL_REGEXP = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
11+
const EMAIL_REGEXP = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@']+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
1212
/* tslint:enable */
1313
if (value.length <= 5 || !EMAIL_REGEXP.test(control.value)) {
1414
return {

src/app/forgot-password/forgotPassword.component.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
import { Component, OnInit } from '@angular/core';
2-
import { FormBuilder, FormGroup, Validators, FormControl } from "@angular/forms";
2+
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
33

44
import { EmailValidator } from '../email-validator';
55

66
@Component({
7-
selector: 'forgot-password',
7+
selector: 'sv-forgot-password',
88
providers: [],
9-
styles: [require('./forgotPassword.scss')],
10-
template: require('./forgotPassword.html')
9+
styles: [require('./forgotPassword.component.scss')],
10+
template: require('./forgotPassword.component.html')
1111
})
1212
export class ForgotPassword implements OnInit {
1313

1414
form: FormGroup;
1515
submitted = false;
1616
validSubmit = false;
1717

18-
constructor(private _fb: FormBuilder) {
18+
constructor(private fb: FormBuilder) {
1919

2020
}
2121

2222
ngOnInit() {
2323

24-
this.form = this._fb.group({
24+
this.form = this.fb.group({
2525
email: new FormControl('',
2626
Validators.compose([
2727
Validators.required,

0 commit comments

Comments
 (0)