Skip to content

Instantly share code, notes, and snippets.

fergusg

Block or report user

Report or block fergusg

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fergusg
fergusg / veto-click-usage.ts
Last active Nov 29, 2015
Example usage of veto
View veto-click-usage.ts
@Component({
selector: 'home'
})
@View({
template: `
<h1>Sandbox</h1>
<a [veto-router-link]="['/Heroes']" [veto-if]="true">Heroes (vetoed)</a>
<a [veto-router-link]="['/Heroes']" [veto-if]="false">Heroes</a>
`,
@fergusg
fergusg / veto-click.ts
Last active Nov 29, 2015
Vetoing a href click in Angular2
View veto-click.ts
import {Component, View, Directive} from 'angular2/angular2';
import {Router, Instruction} from 'angular2/router';
@Directive({
// This is a CSS selector. It's confusing that the template syntax ALSO uses []
selector: "[veto-router-link]",
host: {
"(click)": "onClick($event)",
"[attr.href]": "getLink()"
},
You can’t perform that action at this time.