Angular UI, Bootstrap Navbar Collapse and Javascript

后端 未结 2 1235
广开言路
广开言路 2020-12-24 13:33

I have trouble with UI-Router in many ways. I don\'t understand how it interacts with other frameworks.

Namely, I am trying to implement Bootstrap 3\'s navbar collap

2条回答
  •  遥遥无期
    2020-12-24 13:59

    You should replace bootstrap native js properties with ui-bootstrap directives (note the ng-click and collapse):

    
    

    Set the initial value in your controller:

    $scope.navbarCollapsed = true;
    

    Edit:

    New versions of ui-bootstrap prefix all compontents. Adjust your code accordingly eg. collapse -> uib-collapse.

提交回复
热议问题