在点击角UI bootstap选项卡选择功能 [英] angular-ui bootstap tab select function on click

查看:111
本文介绍了在点击角UI bootstap选项卡选择功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图致电标签的前pression功能选择采用了棱角分明的用户界面引导,但是前pression不被调用,但对角督察检查功能/ EX pression存在:以下是我的code的工作:

Am trying to call an expression function on tab select using angular ui bootstrap , however the expression is not being called but checking on angular inspector the function /expression exists : below is my code work :

注:其它标签正常工作

角视图

<uib-tab ng-click="vm.alertMe" select="" heading="New Invoice">
                          .....
 </uib-tab>

作为VM控制器

vm.alertMe = alertMe;

 function alertMe() {
            setTimeout(function() {
              $window.alert('You\'ve selected the alert tab!');
            });
          } 

请帮帮忙?

推荐答案

始终注入你在你的角度应用程序中使用基本的服务的名称,在上面的例子中我没有打电话: $窗口服务,导致错误/错误。我的最终控制人为如下:

Always inject the base service names you use in your angular app ,in the above example i was not calling : $window service which resulted in the bug / error .my final controller is as following :

function() {

    'use strict';

    angular
        .module('app.patients')
        .controller('PatientsController', PatientsController);

    PatientsController.$inject = ['$http','$window'];
    /* @nginject */
    function PatientsController($http, $window) { 
       vm.alertMe = function() {

             $window.alert('You\'ve selected the alert tab!');
           }
     }
}

和看法,

<uib-tab  select="vm.alertMe()" heading="New Invoice">
                          .....
 </uib-tab>

这篇关于在点击角UI bootstap选项卡选择功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆