これまでは、クリックしたアイテムに応じてタイトルを変更するためのブートストラップ・ドロップダウン・ボタンを手に入れました。作成方法タイトルを変更するドロップダウンボタンのリンクが異なりますか?
しかし、それ以外にも、私はそれらをクリックすると、すべてのドロップダウン項目は、独自のリンクを持っていると思います。
どうすればいいですか?
HTML
<div ng-app='myApp'>
<div ng-controller='DropdownCtrl'>
<div class="btn-group" uib-dropdown is-open="status.isopen">
<button id="single-button" type="button" class="btn btn-primary" uib-dropdown-toggle ng-disabled="disabled">
{{button}} <span class="caret"></span>
</button>
<ul class="uib-dropdown-menu" role="menu" aria-labelledby="single-button">
<li role="menuitem">
<a href="#" ng-click="change(action)" ng-repeat="action in actions">{{action}}</a>
</li>
</ul>
</div>
</div>
</div>
CSS
angular.module('myApp', ['ui.bootstrap']).controller('DropdownCtrl', function($scope) {
$scope.button = "Button dropdown";
$scope.actions = [
"Action", "Another Action", "Something else here"
];
$scope.change = function(name){
$scope.button = name;
}
});
[ng-href](https://docs.angularjs.org/api/ng/directive/ngHref) – giorgio
@giorgio少しの例を教えてください。 –