I am currently developing a Chrome app using TypeScript (Angular2) and I want to implement push notifications. Here is the code snippet for my notification service:
import {Injectable} from 'angular2/core';
@Injectable()
export class NotificationService {
constructor() {
if(Notification.permission !== 'granted') {
Notification.requestPermission();
}
}
}
During the gulp build process, I encountered this error message:
src/scripts/stream/notification.service.ts(6) Cannot find name 'Notification'.
I attempted to use the /* tslint:disable */ comment syntax around my class, but it did not resolve the issue.
Is there a way to define 'Notification' as a global variable in the tslint.json file?
In jshint, the configuration would look something like this:
"globals": {
"Notification": false
}