Copy code from angular-bootstrap-nav-tree.