Sometimes you may need to operate the navigation history manually. The following example shows how to remove a button from the default view navigation, in this case—the Back button. Is assumes you are working on a my-view Blank-type view that has the vehicles collection added as a Data Service. Make the changes in the my-view.component.tns.ts file:


import { Inject, Injector } from '@angular/core';
import { MyViewViewBaseComponent } from '@src/app/modules/my-mod/my-view/my-view.base.component';
import { isAndroid } from 'tns-core-modules/platform';
import { Page } from 'tns-core-modules/ui/page';

export class MyViewViewComponent extends MyViewViewBaseComponent {
    page: Page;

    constructor(@Inject(Injector) injector: Injector) {
        super(injector);
        this.page = injector.get(Page);
    }

    ngAfterViewInit() {
        if (isAndroid) {
            this.page.actionBar.navigationButton.visibility = "collapsed";
        } else {
            this.page.actionBar.actionItems.removeItem(this.page.actionBar.actionItems.getItemAt(0));
        }
    }
}