Jose A Jose A - 11 months ago 62
AngularJS Question

What is the name convention for interfaces in Angular 2?

Doesn't seem to be an explicit place with this information:

I have always named interface files as

IMyInterfaceName.extension
and the interface as
IMyInterface
.

Is that the way to go with Angular 2 and Typescript?

Thanks :)

Answer Source

According to NAMING.md.

In general Angular2 should follow TypeScript naming conventions. See: https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines

What does it say about interfaces?

Interfaces:

Follow the same rules as Classes
Should not have I or Interface in the name or any other way of identifying it as an interface.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download