ngOnInit()

in ui/angular/src/app/measure/measure-detail/measure-detail.component.ts [84:117]


  ngOnInit() {
    this.ruleData = {
      evaluateRule: ""
    };
    let getModel = this.serviceService.config.uri.getModel;
    this.currentId = this.route.snapshot.paramMap.get("id");
    this.getModelUrl = getModel + "/" + this.currentId;
    this.http.get(this.getModelUrl).subscribe(
      data => {
        this.ruleData = data;
        if (this.ruleData["measure.type"] === "external") {
          this.ruleData.type = this.ruleData["measure.type"].toLowerCase();
          this.ruleData.dqType = this.ruleData["dq.type"].toLowerCase();
        } else {
          this.ruleData.type = this.ruleData["dq.type"].toLowerCase();
          this.currentrule = this.ruleData["evaluate.rule"].rules;
          if (this.ruleData["rule.description"]) {
            this.ruleDes = this.ruleData["rule.description"].details
          }
          this.fetchData("source", 0);
          if (this.ruleData.type.toLowerCase() === "accuracy") {
            this.fetchData("target", 1);
          } else {
            this.targetDB = "";
            this.targetTable = "";
          }
        }
      },
      err => {
        console.log("error");
        // toaster.pop('error', 'Error when geting record', response.message);
      }
    );
  }