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

Angular 4 #99

Open
felipelopes6 opened this issue Feb 26, 2018 · 3 comments
Open

Angular 4 #99

felipelopes6 opened this issue Feb 26, 2018 · 3 comments

Comments

@felipelopes6
Copy link

How can I use with angular 4+ version?

I tried this #81 solution, but it doesn't work

@felipelopes6
Copy link
Author

So, I found this solution:

I opened my typing.d.ts and then:

declare class SmartBanner {
  constructor (object: any) 
}

and in the app.component.ts I implemented a AfterViewInit:

ngAfterViewInit() {    

    new SmartBanner({
      daysHidden: 15,   // days to hide banner after close button is clicked (defaults to 15)
      daysReminder: 90, // 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: 'MyPage',
      author: 'MyCompany LLC',
      button: 'VIEW',
      store: {
          ios: 'On the App Store',
          android: 'In Google Play',
          windows: 'In Windows store'
      },
      price: {
          ios: 'FREE',
          android: 'FREE',
          windows: 'FREE'
      }
      // , theme: '' // put platform type ('ios', 'android', etc.) here to force single theme on all device
      // , icon: '' // full path to icon image if not using website icon image
      // , force: 'ios' // Uncomment for platform emulation
    });
  }

And works fine!

screen shot 2018-02-27 at 11 25 05

@GabLeRoux
Copy link
Collaborator

Thanks for sharing this, we should add this to the documentation.

@AkashSurana
Copy link

AkashSurana commented May 26, 2018

I'm new to Angular 2
Can you please give more details like:

  1. How did you create your own .d.ts file and in which folder ?
  2. How did you import your folder in the angular project ?
  3. Where are you using the meta tags ? inside your index.html or inside your component ?

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

3 participants