如何在AngularJS中制作动态工具提示?

时间:2016-07-22 05:06:24

标签: javascript jquery angularjs

我想在工具提示中查看我的动态内容请检查我的代码

JS

function workTitle($worktype) {
    var $title = '';
    if ($worktype === 1) {
        $title = "Print Ready File";
    } else if ($worktype === 2) {
        $title = "Design Work";
    } else if ($worktype === 3) {
        $title = "Design Only";
    } else if ($worktype === 4) {
        $title = "Website";
    }
    return $title;
}

function workType($worktype) {
    var $ass = '';
    if ($worktype == 1) {
        $ass = "p";
    } else if ($worktype == 2) {
        $ass = "d";
    } else if ($worktype == 3) {
        $ass = "do";
    } else if ($worktype == 4) {
        $ass = "w";
    }
    return $ass;
}

控制器

$scope.work_type = function(work_type) {
    return $scope.ship= workType(work_type);
};
$scope.work_title = function(wtype) {
    return $scope.title= workTitle(wtype);
};

视图

<span class="badge"
   uib-tooltip="{{work_title(order.Order.work_type) | uppercase}}"
   ng-bind-html="work_type(order.Order.work_type) | uppercase"></span>

在我的HTML代码ng-bind-html上方工作正常。但我想在uib-tooltip属性中显示完整文字。请帮帮我。

0 个答案:

没有答案