using external JS libraries in my angular 2 project

If you use angular-cli, you can add all your external JS files in assets folder. And then in angular-cli.json add them: “scripts”: [ “../node_modules/jquery/dist/jquery.min.js”, “../node_modules/bootstrap/dist/js/bootstrap.min.js”, “../node_modules/moment/moment.js”, “../node_modules/chart.js/dist/Chart.bundle.min.js”, “../node_modules/chart.js/dist/Chart.min.js”, “../node_modules/ng2-datetime/src/vendor/bootstrap-datepicker/bootstrap-datepicker.min.js”, “./assets/js/slimscroll.min.js”, “./assets/js/inspinia.js”, “./assets/js/metisMenu.js”, “./assets/js/footable.all.min.js” ] You can do it also with external styles: “styles”: [ “../node_modules/ng2-toastr/bundles/ng2-toastr.min.css”, “../node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss”, “../node_modules/font-awesome/scss/font-awesome.scss”, “../node_modules/ng2-datetime/src/vendor/bootstrap-datepicker/bootstrap-datepicker3.min.css”, “./assets/scss/plugins/footable/footable.core.css”, “./assets/scss/style.scss” ] And of course you … Read more

ionViewWillEnter vs ionViewDidEnter

sebaferreras answer is great but it is missing some points. First, about ionic life cycle. If you write down all ionic events and put a console.log in each, you will see the scenario: constructor –> ionViewDidLoad –> ionViewWillEnter –> ionViewDidEnter –> ionViewWillLeave –> ionViewDidLeave –> ionViewWillUnload. constructor run first when the page is initiated. This … Read more

How to use angular 2 service with Ionic 2?

There is no use of Bootstrap() in Ionic2, only use of @App to declare your app. You still need to declare your service in your @Page component. Create your service import {Injectable} from “angular2/core”; import {Http} from “angular2/http”; @Injectable() export class DataService { constructor(http: Http) { this.http = http; this.data = null; } retrieveData() { … Read more

background geolocation ionic 3 not updating

Looking at examples e.g dnchia/Ionic3-Background-Geolocation you would configure the interval on the background, as well as the periodic foreground send gps.ts startTracking(interval) { console.log(‘started tracking’) const config: BackgroundGeolocationConfig = { desiredAccuracy: 10, stationaryRadius: 20, distanceFilter: 30, debug: false, // enable this hear sounds for background-geolocation life-cycle. stopOnTerminate: false, interval: interval }; app.component.ts interval = 30000; … Read more

How to remove the padding around ion-item?

For those who are using ionic 4, you should use Ionic CSS Utilties for padding In short, you have to code this: <ion-item class=”ion-no-padding”> <ion-thumbnail> <img class=”imgmg” src=”https://stackoverflow.com/questions/49569679/…”> </ion-thumbnail> <h2>Text</h2> </ion-item> If you want to remove inner paddding, use ion-item custom CSS properties: ion-item { –padding-end: 0px; –inner-padding-end: 0px; // here other custom CSS from … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)