'Angular mat-tree > close siblings

I'm wondering, is there a built-in method / option or someone has found a way to close siblings of mat-tree node, to allow only one level to be opened at the same time?

let's say I have a tree with 3 levels:

tree
    level 1
          (first) level 2
                        level 3       
                        level 3       
                        level 3     
          (second)level 2 
                        level 3       
                        level 3  
    level 1

I need to close second level 2 with its inner levels if I click on first level 2 node etc

Any help appreciated!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source