File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 11/// <reference path="../../typings/_custom.d.ts" />
22/*
33 * Angular 2
4+ * @coreDirectives : collection of Angular core directives
5+ * @formDirectives : list of all the form directives
6+ * @routerDirectives : list of all the router directives
47 */
58import { coreDirectives , formDirectives } from 'angular2/angular2' ;
69import { routerDirectives } from 'angular2/router' ;
Original file line number Diff line number Diff line change 1+ /// <reference path="../../../typings/_custom.d.ts" />
2+ /*
3+ * Angular 2
4+ * @Directive : factory function
5+ * @ElementRef : class, reference to the element
6+ */
7+ import { Directive , ElementRef } from 'angular2/angular2' ;
8+ // Simple example directive that fixes autofocus problem with multiple views
9+ @Directive ( {
10+ selector : '[autofocus]' // using [ ] means selecting attributes
11+ } )
12+ export class Autofocus {
13+ constructor ( public el : ElementRef ) {
14+ // autofocus fix for multiple views
15+ if ( this . el . nativeElement . focus ) {
16+ this . el . nativeElement . focus ( ) ;
17+ }
18+ }
19+ }
You can’t perform that action at this time.
0 commit comments