1
を条件としてng-switch
を作成しようとしています。 ng-if
でうまく動作しますが、がないので、ng-switch-default
に感謝します。私もこの例でthis codepenを書いたng-switchはmd-tabsで動作しません
angular.module('app', ['ngMaterial'])
.controller('all', function($scope, $element) {
$scope.tabs = [
{label: 'tab1'},
{label: 'tab2'}];
});
:
<div ng-controller="all">
<select ng-switch="var">
<option value="t1">Type 1</option>
<option value="t2">Type 2</option>
</select>
<md-tabs ng-switch="var">
<md-tab ng-switch-when="t1" label="{{tab.label}}" ng-repeat="tab in tabs">
<!-- content for tabs using type 1 -->
</md-tab>
<md-tab ng-switch-when="t2" label="{{tab.label}}" ng-repeat="tab in tabs">
<!-- content for tabs using type 2 -->
</md-tab>
</md-tabs>
</div>
とスクリプト:
は、ここでの例のHTMLです。 何が間違っていますか?あなたはdivの内側にラップする必要が