J.Doe
J.Doe

Reputation: 606

Angular Interface: use brackets in label name

I am trying to create an Interface with labels that contain brackets like this:

export interface Interface{
    label1: number;
    label(test): number;
}

How could i use brackets in the label name?

Upvotes: 0

Views: 53

Answers (1)

Michael Kang
Michael Kang

Reputation: 52867

The only way is to add quote around the property:

export interface Interface{
  label1: number;
  'label(test)': number;
}

Upvotes: 1

Related Questions