0

I have imported a Table with pagination component in my project. I am getting this error:

Unexpected token. A constructor, method, accessor, or property was expected.

It's showing an error because of this interface code:

export  interface PeriodicElement {
 name: string;
 position: number;
 weight: number;
 symbol: string;
}

I have seen many suggestions for fixing the same error in Stack Overflow, but nothing worked for me. I am aware about the concept of interfaces, but it is new to me. Where did I go wrong?

2
  • Are you declaring an interface in the separate file? Commented Aug 31, 2018 at 4:48
  • I was created export interface PeriodicElement { ..... } inside another class export class EditSessionComponent implements OnInit { } so the error was coming, Now its solved. Commented Aug 31, 2018 at 5:05

1 Answer 1

1

Your provided code works without error:

enter image description here

You are probably using the interface in a place where A constructor, method, accessor, or property was expected. An interface is none of these things.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.