The following example extends the my-view.component.tns.ts file for a Blank-type view called "my-view". The code loads a specific entity from the Vehicle collection by ID. You need to add vehicles as a data service to the view beforehand.


import { Inject, Injector } from '@angular/core';
import { MyViewViewBaseComponent } from '@src/app/modules/my-mod/my-view/my-view.base.component';
import { of } from 'rxjs';

export class MyViewViewComponent extends MyViewViewBaseComponent {
    constructor(@Inject(Injector) injector: Injector) {
        super(injector);

        const currentState = this.vehicleService.dataState.getCurrent();
        // set the id of the desired entity to load
        // can be copied from console.kinvey.com
        currentState.id = '5b9a538fe1d636567d4ffdec'; 
        this.vehicleService.dataState.onChanges(of(currentState));
    }
}