Created
January 4, 2016 16:52
-
-
Save odoe/d490c1db98f8697dada5 to your computer and use it in GitHub Desktop.
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, ElementRef } from 'angular2/core'; | |
import { HomeViewModel } from 'esri-mods'; | |
@Component({ | |
selector: 'esri-home', | |
template: '<a class="esri-home" href="#" (click)="onClick($event)"><i class="material-icons">home</i></a>', | |
styles: [ | |
` | |
@import url('https://fonts.googleapis.com/icon?family=Material+Icons'); | |
.esri-home { | |
position: absolute; | |
right: 1em; | |
top: 1em; | |
padding: 1em; | |
color: rgba(255,255,255,1); | |
} | |
.esri-home:hover { | |
color: rgba(255,255,255,0.75); | |
} | |
.esri-home>i { | |
font-size: 3em; | |
text-shadow: 1px 1px 2px black; | |
} | |
` | |
] | |
}) | |
export class HomeComponent { | |
vm: HomeViewModel = null; | |
constructor() { | |
this.vm = new HomeViewModel({}); | |
} | |
setView(view) { | |
this.vm.view = view; | |
} | |
onClick(e) { | |
e.preventDefault(); | |
if (!this.vm.view) { | |
return; | |
} | |
this.vm.goHome(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment