Open kodeine opened 7 years ago
Did you find a solution to this?
Any solutions for this?
Everything is working as expected using Angular2 / Typescript (Ionic). What's not working for you?
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 :")
no solution yet?
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
});
}
...
I tried this : https://github.com/kudago/smart-app-banner/issues/99
How can we use it with typescript/ angular2?