Set dynamic template variable in a dynamically rendered html with AngularCan HTML checkboxes be set to readonly?How can I set the default value for an HTML <select> element?JavaScript set object key by variableCannot display HTML stringAngular HTML bindingLocal variable in template returning null (ionic)Adding expansion panel to the row inside angular material tableAngular change detection after template renderAngular5 Material -> Close mat-expansion-panel when switch TABIs mat-expansion-panel lazy rendering broken?

How can mimic phobia be cured?

Why is short-wave infrared portion of electromagnetic spectrum so sensitive to fire?

How can I avoid dust and bubbles when installing window film?

Quoting Keynes in a lecture

Angel of Condemnation - Exile creature with second ability

Using substitution ciphers to generate new alphabets in a novel

Why can Carol Danvers change her suit colours in the first place?

Creepy dinosaur pc game identification

Solve the following system of equations - (3)

PTIJ: Haman's bad computer

How do you respond to a colleague from another team when they're wrongly expecting that you'll help them?

Can a college of swords bard use blade flourish on an OA from dissonant whispers?

How to explain what's wrong with this application of the chain rule?

Recommended PCB layout understanding - ADM2572 datasheet

Pre-mixing cryogenic fuels and using only one fuel tank

How should I address a possible mistake to co-authors in a submitted paper

Is there a way to get `mathscr' with lower case letters in pdfLaTeX?

Why does AES have exactly 10 rounds for a 128-bit key, 12 for 192 bits and 14 for a 256-bit key size?

Why is it that I can sometimes guess the next note?

Does Doodling or Improvising on the Piano Have Any Benefits?

Can disgust be a key component of horror?

Calculate sum of polynomial roots

Does the Linux kernel need a file system to run?

When were female captains banned from Starfleet?



Set dynamic template variable in a dynamically rendered html with Angular


Can HTML checkboxes be set to readonly?How can I set the default value for an HTML <select> element?JavaScript set object key by variableCannot display HTML stringAngular HTML bindingLocal variable in template returning null (ionic)Adding expansion panel to the row inside angular material tableAngular change detection after template renderAngular5 Material -> Close mat-expansion-panel when switch TABIs mat-expansion-panel lazy rendering broken?













0















I'm displaying a dynamically rendered tree like structure with angular material expansion panel, I've customized the expansion panel to show the drop arrow on left with a ternary operator like this:



Customized the expansion panel



This is how i'm rendering the expansion panel:



Parent Component template:



<div>
<ui-tree [data]="data" [key]="key"></ui-tree>
</div>


Child Component template:



 <div *ngIf="items.length">
<mat-expansion-panel hideToggle="true" class="border mat-elevation-z0" *ngFor="let item of items" #toggle (click)="toggle.value = !toggle.value">
<mat-expansion-panel-header>
<mat-panel-title (click)="icon.value ? icon.value = true : icon.value = false;">
<mat-icon>toggle.value ? 'navigate_next': 'keyboard_arrow_down'</mat-icon>
<div class="col-md-9">
item.name
</div>
</mat-panel-title>
</mat-expansion-panel-header>
<button mat-button>Add Role</button>

<ui-tree *ngIf="item[key].length" [key]="key" [data]="item[key]"></ui-tree>
</mat-expansion-panel>
</div>


I want the to change in the header on click, Icon should point right if closed and point down if open.
How do I achieve this?










share|improve this question




























    0















    I'm displaying a dynamically rendered tree like structure with angular material expansion panel, I've customized the expansion panel to show the drop arrow on left with a ternary operator like this:



    Customized the expansion panel



    This is how i'm rendering the expansion panel:



    Parent Component template:



    <div>
    <ui-tree [data]="data" [key]="key"></ui-tree>
    </div>


    Child Component template:



     <div *ngIf="items.length">
    <mat-expansion-panel hideToggle="true" class="border mat-elevation-z0" *ngFor="let item of items" #toggle (click)="toggle.value = !toggle.value">
    <mat-expansion-panel-header>
    <mat-panel-title (click)="icon.value ? icon.value = true : icon.value = false;">
    <mat-icon>toggle.value ? 'navigate_next': 'keyboard_arrow_down'</mat-icon>
    <div class="col-md-9">
    item.name
    </div>
    </mat-panel-title>
    </mat-expansion-panel-header>
    <button mat-button>Add Role</button>

    <ui-tree *ngIf="item[key].length" [key]="key" [data]="item[key]"></ui-tree>
    </mat-expansion-panel>
    </div>


    I want the to change in the header on click, Icon should point right if closed and point down if open.
    How do I achieve this?










    share|improve this question


























      0












      0








      0








      I'm displaying a dynamically rendered tree like structure with angular material expansion panel, I've customized the expansion panel to show the drop arrow on left with a ternary operator like this:



      Customized the expansion panel



      This is how i'm rendering the expansion panel:



      Parent Component template:



      <div>
      <ui-tree [data]="data" [key]="key"></ui-tree>
      </div>


      Child Component template:



       <div *ngIf="items.length">
      <mat-expansion-panel hideToggle="true" class="border mat-elevation-z0" *ngFor="let item of items" #toggle (click)="toggle.value = !toggle.value">
      <mat-expansion-panel-header>
      <mat-panel-title (click)="icon.value ? icon.value = true : icon.value = false;">
      <mat-icon>toggle.value ? 'navigate_next': 'keyboard_arrow_down'</mat-icon>
      <div class="col-md-9">
      item.name
      </div>
      </mat-panel-title>
      </mat-expansion-panel-header>
      <button mat-button>Add Role</button>

      <ui-tree *ngIf="item[key].length" [key]="key" [data]="item[key]"></ui-tree>
      </mat-expansion-panel>
      </div>


      I want the to change in the header on click, Icon should point right if closed and point down if open.
      How do I achieve this?










      share|improve this question
















      I'm displaying a dynamically rendered tree like structure with angular material expansion panel, I've customized the expansion panel to show the drop arrow on left with a ternary operator like this:



      Customized the expansion panel



      This is how i'm rendering the expansion panel:



      Parent Component template:



      <div>
      <ui-tree [data]="data" [key]="key"></ui-tree>
      </div>


      Child Component template:



       <div *ngIf="items.length">
      <mat-expansion-panel hideToggle="true" class="border mat-elevation-z0" *ngFor="let item of items" #toggle (click)="toggle.value = !toggle.value">
      <mat-expansion-panel-header>
      <mat-panel-title (click)="icon.value ? icon.value = true : icon.value = false;">
      <mat-icon>toggle.value ? 'navigate_next': 'keyboard_arrow_down'</mat-icon>
      <div class="col-md-9">
      item.name
      </div>
      </mat-panel-title>
      </mat-expansion-panel-header>
      <button mat-button>Add Role</button>

      <ui-tree *ngIf="item[key].length" [key]="key" [data]="item[key]"></ui-tree>
      </mat-expansion-panel>
      </div>


      I want the to change in the header on click, Icon should point right if closed and point down if open.
      How do I achieve this?







      javascript html angular angular-material2 angular-dynamic-components






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 11 hours ago







      Jawad Farooqi

















      asked yesterday









      Jawad FarooqiJawad Farooqi

      9418




      9418






















          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55280574%2fset-dynamic-template-variable-in-a-dynamically-rendered-html-with-angular%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55280574%2fset-dynamic-template-variable-in-a-dynamically-rendered-html-with-angular%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해