1

我在我的应用程序中使用 angular js 使用 kendo tabstrip。标签条和内容看起来很好。

我可以通过 k-options 获取从角度调用的选项卡事件或设置事件吗?

需要帮助

4

2 回答 2

8

我使用无范围,但与乔提到的相同......

HTML:如果您使用 $scope,只需删除“vm”。

<div kendo-tab-strip="vm.tabstrip" k-options="vm.tabOptions" k-content-urls="[null, null]">

控制器:(如果您使用 $scope,只需将“vm”替换为“$scope”

vm.tabOptions = {
            select: function (e) {
                console.log("Selected: " + e.item.innerText);
            },
            activate: function (e) {
                console.log("Activated: " + e.item.innerText);
            },
            show: function (e) {
                console.log("Shown: " + e.item.innerText);
            },
            contentLoad: function (e) {
                console.log("Content loaded in " + e.item.innerText);
            },
            error: function (e) {
                console.log("Loading failed with " + e.xhr.statusText + " " + e.xhr.status);
            }
        };
于 2015-02-26T06:01:14.810 回答
2

如果您设置了标签条,则可以通过以下方式处理事件k-options

<div kendo-tab-strip k-options="configOptions" k-content-urls="[ null, null]">




<script>
  angular.module("KendoDemos", [ "kendo.directives" ]);
  function MyCtrl($scope) {
      $scope.hello = "Hello from Controller!";
      $scope.configOptions = {
         change: function(e) {
             console.log("changed");
         }
      }
  }
</script>

那是你要找的吗?

于 2014-10-28T11:43:07.290 回答