Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (24 sloc) 509 Bytes
import { Component } from "../angular-decorators";
import template from "../templates/heroList.html";
@Component("heroList", { template })
export class HeroList
{
// This would be loaded by $http etc.
list =
[
{ name: "Superman", location: "" },
{ name: "Batman", location: "Wayne Manor" }
];
updateHero(hero, prop, value)
{
hero[prop] = value;
};
deleteHero(hero)
{
var idx = this.list.indexOf(hero);
if (idx >= 0)
{
this.list.splice(idx, 1);
}
};
}