Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using with Angular2 / Typescript #81

Open
kodeine opened this issue Mar 9, 2017 · 7 comments
Open

Using with Angular2 / Typescript #81

kodeine opened this issue Mar 9, 2017 · 7 comments

Comments

@kodeine
Copy link

kodeine commented Mar 9, 2017

How can we use it with typescript/ angular2?

@rodneyjoyce
Copy link

Did you find a solution to this?

@Ericky14
Copy link

Ericky14 commented Jul 7, 2017

Any solutions for this?

@FredeHo
Copy link

FredeHo commented Aug 29, 2017

Everything is working as expected using Angular2 / Typescript (Ionic). What's not working for you?

@Galleria
Copy link

you can import libs on .angular-cli.json
"styles": [
"../node_modules/smart-app-banner/dist/smart-app-banner.css"
],
"scripts": [
"../node_modules/smart-app-banner/dist/smart-app-banner.js"
],

and then declare var SmartBanner: any; on component that you would like to use it.
(I added it on app.componen.ts) and added new SmartBanner() on ngAfterViewInit().

finish :")

@felipelopes6
Copy link

felipelopes6 commented Feb 26, 2018

no solution yet?

@Ericky14
Copy link

So, I got it to work for me.

You need to import the styles in .angular-cli.json on the styles property.

...
  "styles": ["../node_modules/smart-app-banner/dist/smart-app-banner.css"]
...

Then on app.components.ts I do

import SmartBanner from 'smart-app-banner';
...
  constructor() {
    new SmartBanner({
      daysHidden: 10,   // days to hide banner after close button is clicked (defaults to 15)
      daysReminder: 20, // days to hide banner after "VIEW" button is clicked (defaults to 90)
      // appStoreLanguage: 'us', // language code for the App Store (defaults to user's browser language)
      title: 'Title',
      author: 'Authot',
      button: 'VIEW',
      store: {
        ios: 'On the App Store',
        android: 'In Google Play'
      },
      price: {
        ios: 'FREE',
        android: 'FREE'
      },
      // force: 'android' // Uncomment for platform emulation
    });
  }
...

@felipelopes6
Copy link

I tried this :
#99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants