Who is akash k and what is akash02designer ?

Ionic 2 Ques and Ans

1. What are the imports used for getting API Data in ionic 2 ?

A. import {Injectable} from '@angular/core';
     import {Http} from '@angular/http';
     import 'rxjs/Rx';


2. Function which loads on page load in ionic 2 ?
A.   ngOnInit()
      {

      }

3. What are the imports used for passing parameters in ionic 2 ?
A. import { NavController, NavParams } from 'ionic-angular';


4. How to pass parameter from page to page in Ionic 2 ?

A.   this.navCtrl.push(DetailsPage,{
       item:item
       });


5. How to get parameter from other page in Ionic 2 ?

A. constructor(public navCtrl: NavController, public params:NavParams) {
  this.item=params.get('item');
  }

6. Create a new folder in src folder by command?
A. ionic generate page new-page


7. Add  a click event in button?

A. <button (click)="onload()">Add</button>


8. Immediate reflection method which updates automatic?
A. ionViewWillEnter()
 {

}

9. Ionic background image ?
A.  For home page --> src-->assets

Create a folder "img"

Now go to pages-->home folder
Open home.scss and edit


page-home {

ion-content{
    background-image: url('../assets/img/bg.jpg');
}

}