I'm building a Chrome app. The app is written with TypeScript (Angular2).
I would like to push notifications. Here's the code :
import {Injectable} from 'angular2/core';
@Injectable()
export class NotificationService {
constructor() {
if(Notification.permission !== 'granted') {
Notification.requestPermission();
}
}
}
When gulp build the app, it says :
src/scripts/stream/notification.service.ts(6) Cannot find name 'Notification'.
I tried to wrap my class inside :
/* tslint:disable */
... the code
/* tslint:enable */
But it does not change anything.
Is there a way with tslint.json file to tell Typescript that this is a global variable ?
With jshint it would be something like that :
"globals": {
"Notification": false
}