search

Home  >  Q&A  >  body text

javascript - Instructions modify the content of elements in angular4

@Input('hqConversionCase') hqConversionCaseVal: string;
  @HostBinding() get innerHtml() {
    if (this.hqConversionCaseVal === "upper") {
      return this.innerHtml.toUpperCase();
    }
    if (this.hqConversionCaseVal === "lower") {
      return this.innerHtml.toLowerCase();
    }
  }

This is what I wrote. He always reported that the stack was exceeded. How can I modify the value of the element in the instruction?

世界只因有你世界只因有你2744 days ago861

reply all(1)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-06-12 09:29:35

    return this.innerHtml always calls its own function, so this error will be reported.

    reply
    0
  • Cancelreply