Closed luigiinred closed 7 years ago
Hi Luigiinred, thanks for your message.
According with your description this is an issue with TypeScript, We are working hardly to get a final version for this SDK with total compatibility with TypeScript very soon. For now you can resolve this problem for TypeScript in this way.
HTML
<script src="systemjs.config.js"></script>
<script> System.import('app').catch(function(err){ console.error(err); }); </script> <script src="node_modules/rxjs/bundles/Rx.js"></script>
<script src="node_modules/@angular/core/bundles/core.umd.js"></script>
<script src="node_modules/@angular/common/bundles/common.umd.js"></script>
<script src="node_modules/pubnub/dist/web/pubnub.js"></script>
<script src="node_modules/pubnub-angular2/dist/pubnub-angular2.js"/>
-> component
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `<h1>Hello </h1>`,
})
export class AppComponent {
name = 'Angular';
constructor(){
var pubnubService = new window.PubNubAngular();
console.log(pubnubService); }
}
But if you are working with Javascript plain even for Typescript, you have to reference the Angular2 libraries what I’ll show you to next.
'node_modules/core-js/client/shim.min.js'
'node_modules/rxjs/bundles/Rx.js'
'node_modules/@angular/core/bundles/core.umd.js'
'node_modules/@angular/common/bundles/common.umd.js'
‘node_modules/@angular/compiler/bundles/compiler.umd.js’
Whatever let us know it!
Hi,
thanks for the question and answer. I am starting one-to-one chat + push notifications in Ionic 2 mobile app (Android and iOS) today and am also interested in the final version of this SDK and TypeScript support, so I sign-up here.
@ManuelFernando please let us know when it's ready. Thanks!
@pdrosos I’ll let know you
@pdrosos @luigiinred guys, in this moment we have ready a beta with support for TypeScript, we are very close to get the final version
I have a app build with Ionic2 rc3.
I am including the library with:
I have not registered window.PubNubAngular in my providers
I am getting the error
Can't find variable: ng