Ionic Draft UNSORT

  1. JSON filter and sorting
  2. AngularFireDatabase
  3. Getting key  Controlling back button to specific page
  4. From project folder pass these lines
  5. Tell Git who you are
    First, you need to tell Git who you are:

    git config –global “”
    git config –global “Your Name”

    Give GitHub your public keys

    Some basic Git operations
    When we worked on GitHub, the basic work cycle was fork > edit > commit > pull request > merge. The same cycle, with a few differences, is what we will work through on the commandline.

    $ git status
    # On branch master
    nothing to commit (working directory clean)

  6. Connect n merge coder from dev to tenzin
  7. git checkout dev
    git pull
    git checkout tenzin
    git merge dev
  8. Connect and merge from tenzin to dev branch
    git checkout dev
    git merge t***
    git push
    git checkout t****
  9. To connect to new branch in remote we have to follow this step
    git pull
    git checkout team
    git pull
    git checkout ngodup
    git merge team

    9.git branch commands’ various options. -a shows all local and remote branches, while -r shows only remote branches.

    git branch -a
    git branch -r
    git branch -v -r
  10. There’s also another way to do figure out what branches are on your remote by actually using the remotely related commands, git remote and git ls-remote. The former displays plenty of information about the remote in general and how it relates to your own repository, while the latter simply lists all references to branches and tags that it knows about.
    $ git remote show origin
    $ git ls-remote --heads origin

JSON FILTER N SORTING = this.http.get('/assets/json/drills.json').map(res => {
      return res.json().drillTypes.filter(item => {
        return item.activity == 'Tactic';
      }).map(item => {
        item.serial = Number(item.serial);
        return item;
      }).sort(function (v1, v2) {
        if (v1.serial < v2.serial) {
          return -1;
        } else if (v1.serial > v2.serial) {
          return 1;
        } else {
          return 0;
<ion-content padding>
  <ion-card *ngFor="let item of data | async">
    <ion-item (click)="goDrill(item)">
      <ion-avatar item-start>
        <img *ngIf="item.isHand" src="../../../assets/hand.png">
        <img *ngIf="item.isRacquet" src="../../../assets/racquet.png">
      <h4>{{activity}} {{typeName}} {{serial}}<br/>{{item.type}} {{item.serial}}</h4>
      <button ion-button color="dark" clear item-right>
        <ion-icon name="arrow-forward"></ion-icon>

      <div [innerHTML]="item.description"></div>



Add the code typescript

import { AngularFireDatabase } from 'angularfire2/database';
import { DrillPage } from '../drill/drill';

export class DrillListPage {

  drills: any;
  constructor(public navCtrl: NavController, public navParams: NavParams, private db: AngularFireDatabase) {
    this.drillPage = DrillPage;

    this.drills = this.db.list('/drills').snapshotChanges().map(changes => {
      return => ({ 
        key: drill.payload.key, 

Add template for accessing key 

    <button ion-item *ngFor="let drill of drills | async" (click)="itemTapped($event, drill)">
          <ion-col col-11>
            <h2>Drill key - {{drill.key}}</h2>
              <h4>{{drill.type}} {{drill.serial}}</h4>
            <span [innerHTML]="drill.description"></span>
          <ion-col col-1>
              <ion-icon name="arrow-forward"></ion-icon>

For Angulardatabase CRUD more information –

  private deleteFileData(key: string) {
    return this.db.list('/drillstype').remove(key);



  ionViewDidLoad() {
    this.navBar.backButtonClick = () => {
      let pages = [{
			  page: WelcomePage