Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/417.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 将angularJS模型值传递到引导弹出窗口的问题。获得;“未定义”;价值_Javascript_Jquery_Html_Angularjs_Twitter Bootstrap - Fatal编程技术网

Javascript 将angularJS模型值传递到引导弹出窗口的问题。获得;“未定义”;价值

Javascript 将angularJS模型值传递到引导弹出窗口的问题。获得;“未定义”;价值,javascript,jquery,html,angularjs,twitter-bootstrap,Javascript,Jquery,Html,Angularjs,Twitter Bootstrap,我对angularjs是新手。我试图在bootstrap popover上显示角度模型值,但其显示的值“未定义” 我无法将angularJs模型值传递到引导弹出窗口。这是我在控制器页面(cshtml)中的代码 我创建了这个指令 App.directive('customPopover', function () { return { restrict: 'AE', scope:false, scope: {

我对angularjs是新手。我试图在bootstrap popover上显示角度模型值,但其显示的值“未定义”

我无法将angularJs模型值传递到引导弹出窗口。这是我在控制器页面(cshtml)中的代码

我创建了这个指令

App.directive('customPopover', function () {
        return {
            restrict: 'AE',
            scope:false,
            scope: {
                ngModel: '='
            },
            template: '<button type="button" class="btn btn-info">{{label}}</button>',
            replace: true, link: function ($scope, elem, attr, ctrl) {
                var string = attr.popoverHtml.split(",");
                console.log($scope);
                console.log($scope.ngModel);
                $scope.label = attr.popoverLabel;
                $(elem).popover({
                    trigger: 'click',
                    html: true,
                    content: '<b>id : </b>' + string[0] + '<br/> <b>datetime : </b>' + string[1],
                    placement: attr.popoverPlacement, title: 'Details',
                    template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
                });
            }
        };
    });
App.directive('customPopover',function(){
返回{
限制:“AE”,
范围:假,
范围:{
ngModel:“=”
},
模板:“{label}}”,
替换:true,链接:function($scope,elem,attr,ctrl){
var string=attr.popoverHtml.split(“,”);
console.log($scope);
log($scope.ngModel);
$scope.label=attr.popopoOverlabel;
$(elem).popover({
触发器:“单击”,
是的,
内容:“id:'+字符串[0]+'
日期时间:'+字符串[1], 位置:attr.popoverPlacement,标题:“详细信息”, 模板:“” }); } }; });
//我甚至试过这样-

我还尝试使用文本输入,该文本框中的值显示良好。我能够在控制器上获取值,并在文本框中使用,但不能在popover中使用

 <input type="text" ng-model="DetailsData.detailInfo" />


当我点击弹出按钮时,弹出标题显示为详细信息,id显示为空白,日期时间:未定义。谁能帮帮我,我哪里做错了?我想在弹出窗口上获取Id:旁边的scope.DetailsData.UPDATED_值和datetime:旁边的$scope.DetailsData.UPDATED_日期值。谢谢。

我甚至试过这样,但运气不好。试一下{{DetailsData.UPDATED_BY+','+DetailsData.UPDATED_DATE}我甚至试过这样,但运气不好。试一下{{DetailsData.UPDATED_BY+','+DetailsData.UPDATED_DATE}
App.directive('customPopover', function () {
        return {
            restrict: 'AE',
            scope:false,
            scope: {
                ngModel: '='
            },
            template: '<button type="button" class="btn btn-info">{{label}}</button>',
            replace: true, link: function ($scope, elem, attr, ctrl) {
                var string = attr.popoverHtml.split(",");
                console.log($scope);
                console.log($scope.ngModel);
                $scope.label = attr.popoverLabel;
                $(elem).popover({
                    trigger: 'click',
                    html: true,
                    content: '<b>id : </b>' + string[0] + '<br/> <b>datetime : </b>' + string[1],
                    placement: attr.popoverPlacement, title: 'Details',
                    template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
                });
            }
        };
    });
 <input type="text" ng-model="DetailsData.detailInfo" />