Originally, _currentDepth++ is in ngOnChanges() as initialization,
which means, when instantiate a child node, init as its _currentDepth++.
However, it brings a bug: when user update data in the top parent node,
_currentDepth will be added one unintented, the view will looks like
depth get minus one.
Originally,
_currentDepth++
is inngOnChanges()
as initialization, which means, when instantiate a child node, init as its_currentDepth++
. However, it brings a bug: when user update data in the top parent node,_currentDepth
will be added one unintented, the view will looks like depth get minus one.bug video demo