shawnlauzon / typed-soundcloud

TypeScript typing definitions for SoundCloud
MIT License
2 stars 1 forks source link

Modals not showing when I use soundcloud api with typings in my Ionic2 project #2

Open csguedes opened 8 years ago

csguedes commented 8 years ago

PROBLEM: no modals are showing and no DOM update is automatically triggered (I need to call changeDetectorRef.detectChanges() ), when I import and use SoundCloud API with typings in my Ionic2 project.

How I am importing SoundCloud API to my Ionic2 project:

In command prompt:

npm install soundcloud typings install soundcloud --save

In my TS:

import * as SC from 'soundcloud';

or

import SC = require('soundcloud');

The soundcloud api itself works perfectly (audio streaming, tracks listing). But, no modal will show up in my ionic2 project while this code is inserted in any ts file of my project. Also, no DOM update is automatically triggered.

My ionic info:

Cordova CLI: 6.3.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.10
Ionic CLI Version: 2.0.0-beta.32
Ionic App Lib Version: 2.0.0-beta.18
OS:
Node Version: v6.2.2

NOTE:

If I remove soundcloud code, modals will show up again. Also, DOM updates will get triggered again.

No errors/warnings are shown in console.

Any ideas?

csguedes commented 8 years ago

I temporarily solved the problem by adding:

setTimeout(() => { this._applicationRef.tick(); }, 200);

But I still don't understand why DOM does not update automatically after importing soundcloud typings.