File

src/app/manage-learn/reports/observation-solution-entity-listing/observation-solution-entity-listing.component.ts

Metadata

Index

Properties
Methods

Constructor

constructor(router: Router, toast: ToastService)
Parameters :
Name Type Optional
router Router No
toast ToastService No

Methods

goToReports
goToReports(entity)
Parameters :
Name Optional
entity No
Returns : void

Properties

solutionDetails
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { RouterLinks } from '@app/app/app.constant';
import { ToastService } from '../../core';

@Component({
  selector: 'app-observation-solution-entity-listing',
  templateUrl: './observation-solution-entity-listing.component.html',
  styleUrls: ['./observation-solution-entity-listing.component.scss'],
})
export class ObservationSolutionEntityListingComponent {
  solutionDetails;

  constructor(private router: Router, private toast: ToastService) {
    console.log(this.router.getCurrentNavigation().extras.state);
    this.solutionDetails = this.router.getCurrentNavigation().extras.state;
  }


  goToReports(entity) {

    let state = {
      scores: false,
      observation: true,
      entityId: entity._id,
      entityType: this.solutionDetails.entityType,
      observationId: this.solutionDetails.observationId,
    };
    if (this.solutionDetails.isRubricDriven) {
      state.scores = true;
    }
    if (!this.solutionDetails.criteriaLevelReport) {
      state['filter'] = { questionId: [] };
      state['criteriaWise'] = false;
    }
    this.router.navigate([RouterLinks.GENERIC_REPORT], {
      state: state,
    });
  }
}
<ion-content>
  <div>
    <app-common-header [title]="solutionDetails?.name"
      [subTitle]="solutionDetails?.programName"></app-common-header>
  </div>

  <div>
    <div *ngFor="let entity of solutionDetails?.entities; let solutionIndex = index">
      <app-item-list-card
        [title]="entity?.name"
        [subTitle]="entity?.programName"
        (cardSelect)="goToReports(entity)"
      >
        <ion-icon class="mg-popup-btn-icon" name="arrow-forward" arrow></ion-icon>
      </app-item-list-card>
    </div>
  </div>


  <app-no-data *ngIf="!solutionDetails?.entities?.length"></app-no-data>

</ion-content>

./observation-solution-entity-listing.component.scss

Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""