0
votes

In PrimeNG (Angular components), Message is available in these three packages.

Are these all the same?

Seems all these work to display the messages.

import { Message } from 'primeng/components/common/message';
import { Message } from 'primeng/components/common/api';
import { Message } from 'primeng/api';
2

2 Answers

1
votes

Yes, each of them refers to the same Message interface.

The best to be sure is to read the source code.

In primeng/components/common/api for instance, you can see that the line

export { Message } from './message';

refers to the file primeng/components/common/message where the interface is described :

export interface Message {
    severity?: string;
    summary?: string;
    detail?: string;
    id?: any;
    key?: string;
    life?: number;
    sticky?: boolean;
    closable?: boolean;
    data?: any;
}
-1
votes
import { Message } from 'primeng/api';

I always use this one, and no problems so far.