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

IONIC 2 templates

ionic start –list gives: blank ……………. A blank starter project for Ionic complex-list ……… A complex list starter template maps …………….. An Ionic starter project using Google Maps and a side menu salesforce ……….. A starter project for Ionic and Salesforce sidemenu …………. A starting project for Ionic using a side menu with navigation in … 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