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
import {Directive, Provider, forwardRef, Attribute} from 'angular2/core' | |
import {NG_VALIDATORS, Control, Validator, Validators} from 'angular2/common' | |
import {CONST_EXPR} from 'angular2/src/facade/lang'; | |
import * as modelModule from 'angular2/src/common/forms/model'; | |
import {NumberWrapper} from "angular2/src/facade/lang"; | |
/********* Email Validator **********/ | |
export function emailValidator(control: modelModule.Control):{[key: string]: boolean} { | |
console.log('emailValidator processing'); |
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
import {Component, ViewChild, ViewChildren} from 'angular2/core'; | |
import {Observable} from 'rxjs/Observable'; | |
import {Store} from '@ngrx/store'; | |
import {INCREMENT, DECREMENT, RESET} from './../../../counter'; | |
@Component({ | |
selector: 'my-app', | |
template: ` | |
<button (click)="increment()">Increment</button> | |
<div>Current Count: {{ counter | async }}</div> |
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
import {Pipe, PipeTransform} from 'angular2/core'; | |
import {isBlank, isPresent} from 'angular2/src/facade/lang'; | |
import {StringMapWrapper} from 'angular2/src/facade/collection'; | |
import * as moment from 'moment'; | |
@Pipe({name: 'moment'}) | |
export class MomentPipe implements PipeTransform { | |
static _ALIASES: {[key: string]: String} = { | |
'medium': 'MMM D YYYY, h:mm:ss A', | |
'short': 'M/D/YY, h:mm:ss A', |
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
import {Directive, Input, Provider, forwardRef} from 'angular2/core'; | |
import {NG_VALIDATORS, Control, Validator, Validators} from 'angular2/common'; | |
import {CONST_EXPR} from 'angular2/src/facade/lang'; | |
import * as modelModule from 'angular2/src/common/forms/model'; | |
/********* Email Validator **********/ | |
export function emailValidator(control: modelModule.Control): {[key: string]: boolean} { | |
var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; | |
if (control.value === '' || re.test(control.value)) { |
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
<div class="form-group" [class.has-warning]="!myControl.valid && myControl.touched"> | |
<label *ngIf="type !== 'checkbox'">{{label}}</label> | |
<input *ngIf="type === 'text'" [type]=type class="form-control" | |
[(ngFormControl)]=myControl [requiredVal]=required | |
[patternValidator]="pattern" [focusOn]=focusOn | |
> | |
<input *ngIf="type === 'number'" [type]=type class="form-control" | |
[(ngFormControl)]=myControl [requiredVal]=required | |
[min]=min [max]=max [focusOn]=focusOn | |
> |
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
import { | |
Component, | |
ChangeDetectionStrategy, | |
ChangeDetectorRef, | |
Input | |
} from 'angular2/core'; | |
import {ROUTER_DIRECTIVES} from 'angular2/router'; | |
import {APPLICATION_VALIDATORS} from './application-validators'; | |
import {FocusOn} from './focus-on.directive.ts'; | |
import {Control} from 'angular2/common'; |
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
import { FormControl } from '@angular/forms'; | |
import { AsyncValidatorFn, ValidatorFn } from '@angular/forms/src/directives/validators'; | |
import { Control } from '@angular/common'; | |
import { Injectable } from '@angular/core'; | |
import { Http } from '@angular/http'; | |
import { Observable } from 'rxjs/Observable'; | |
import { ReplaySubject } from 'rxjs/ReplaySubject'; | |
import { API_USER_URL } from '../services/constants'; | |
@Injectable() |
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
const MATERIAL_DESIGN_DIRECTIVES = [ | |
MdButton, | |
MdInput, | |
]; | |
@NgModule({ | |
imports: [ | |
BrowserModule, | |
ReactiveFormsModule, | |
FormsModule, |
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
import { RouterConfig } from '@angular/router'; | |
import { | |
AffiliatesRoutes, | |
ConfigRoutes, | |
CreditsRoutes, | |
Dashboard, | |
OffersRoutes, | |
PrizesRoutes, | |
SitesRoutes, |
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
@NgModule({ | |
imports: [ | |
CommonModule | |
], | |
declerations: [HomeComponent], | |
exports: [HomeComponent] | |
}) | |
export class HomeModule {} |
OlderNewer