Hello Lucas!

Yes, I've missed to import the constant...

import { Hero, DR_EVIL } from './hero.model';

And in that moment I realized, I want something like Hero.DR_EVIL.

So my class looks like this now:

export class Hero {
    public static DR_EVIL = new Hero(666, 'Dr. Evil');
    constructor(public id: number, public name: string) {}
}

It works fine, but another question I have is: How do I make this Object 
immutable?



-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to