Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/422.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 部分html视图';使用KendoPanelBar contenturl的s控制器在指令TemplateUrl中不工作_Javascript_Angularjs_Angularjs Directive_Kendo Ui - Fatal编程技术网

Javascript 部分html视图';使用KendoPanelBar contenturl的s控制器在指令TemplateUrl中不工作

Javascript 部分html视图';使用KendoPanelBar contenturl的s控制器在指令TemplateUrl中不工作,javascript,angularjs,angularjs-directive,kendo-ui,Javascript,Angularjs,Angularjs Directive,Kendo Ui,指令 app.directive('PanelbarDirective', function ($http) { return { restrict: "EA", templateUrl: 'ngview/shared/panelbar.html' }; }); testcontroller.js 'use strict'; app.controller('testcontroller', ['$scope', function testcon

指令

app.directive('PanelbarDirective', function ($http) {
    return {
        restrict: "EA",
        templateUrl: 'ngview/shared/panelbar.html'

    };
});
testcontroller.js

'use strict';
app.controller('testcontroller', ['$scope',
function testcontroller($scope) {
    $scope.LabelValue = 'From Controller';

}]);
panelbar.html

<div id="selected-values" class="col-sm-12 colSlctdValues" >
    <ul id="panelbar"></ul>

    <script>
        $("#panelbar").kendoPanelBar({
            dataSource: [
                {
                    text: "Teachers",
                    expanded: true,
                    contentUrl: "ngview/shared/Teachers.html"
                }
            ]
        });
    </script>


</div>
<table ng-controller="testcontroller">
    <body>
        <tr>
            <td>{{LabelValue}}</td>            
        </tr>
    </body>
</table>
<script>
    $("#panelbar").kendoPanelBar({
        dataSource: [
            {
                text: "Teachers",
                expanded: true,
                contentUrl: "ngview/shared/Teachers.html"
            }
        ]
    });
</script>

    $(“#panelbar”)。肯多帕内巴尔({ 数据源:[ { 正文:“教师”, 对,, contentUrl:“ngview/shared/Teachers.html” } ] });
    Teachers.html

    <div id="selected-values" class="col-sm-12 colSlctdValues" >
        <ul id="panelbar"></ul>
    
        <script>
            $("#panelbar").kendoPanelBar({
                dataSource: [
                    {
                        text: "Teachers",
                        expanded: true,
                        contentUrl: "ngview/shared/Teachers.html"
                    }
                ]
            });
        </script>
    
    
    </div>
    
    <table ng-controller="testcontroller">
        <body>
            <tr>
                <td>{{LabelValue}}</td>            
            </tr>
        </body>
    </table>
    
    <script>
        $("#panelbar").kendoPanelBar({
            dataSource: [
                {
                    text: "Teachers",
                    expanded: true,
                    contentUrl: "ngview/shared/Teachers.html"
                }
            ]
        });
    </script>
    
    
    {{LabelValue}}
    

    我面临的问题是,它总是显示值{{LabelValue}},而不是我在部分视图的控制器中为LabelValue赋值的值。

    只有当我尝试在 panelbar.html

    <div id="selected-values" class="col-sm-12 colSlctdValues" >
        <ul id="panelbar"></ul>
    
        <script>
            $("#panelbar").kendoPanelBar({
                dataSource: [
                    {
                        text: "Teachers",
                        expanded: true,
                        contentUrl: "ngview/shared/Teachers.html"
                    }
                ]
            });
        </script>
    
    
    </div>
    
    <table ng-controller="testcontroller">
        <body>
            <tr>
                <td>{{LabelValue}}</td>            
            </tr>
        </body>
    </table>
    
    <script>
        $("#panelbar").kendoPanelBar({
            dataSource: [
                {
                    text: "Teachers",
                    expanded: true,
                    contentUrl: "ngview/shared/Teachers.html"
                }
            ]
        });
    </script>
    
    
    $(“#panelbar”)。肯多帕内巴尔({
    数据源:[
    {
    正文:“教师”,
    对,,
    contentUrl:“ngview/shared/Teachers.html”
    }
    ]
    });
    
    但是,我修复了使用

        <ul id="panelbar" kendo-panel-bar  k-options="panelBarOptions">
            <li>
                Teachers
                <ul>
                    <li ng-include="'ngview/shared/Teachers.html'"></li>
                </ul>
            </li>
    
        </ul>
    
    • 教师
    希望知道是否还有人能帮助我使用script而不是ulng include

    谢谢,

    看到这个了吗

    
    
    • 身体
    • 引擎
    • 传输
    • 演出
    $(文档).ready(函数(){ $(“#panelbar”)。肯多帕内巴尔({ 扩展模式:“单一”, 内容URL:[ “../content/web/panelbar/ajax/ajaxContent1.html”, “../content/web/panelbar/ajax/ajaxContent2.html”, “../content/web/panelbar/ajax/ajaxContent3.html”, “../content/web/panelbar/ajax/ajaxContent4.html” ] }); }); .包装纸{ 高度:320px; 保证金:20px自动; 填充:20px0; 背景:url('../content/web/panelbar/astonmartin.png')无重复中心50px透明; } #配电盘{ 宽度:250px; 浮动:对; 边缘底部:20px; } #面板条p{ 填充:1em; }

    这部分代码是从KendoUI页面复制粘贴的链接内容,以防链接更改

    欢迎指向解决方案的链接,但请确保您的答案在没有它的情况下是有用的:这样您的其他用户就会知道它是什么以及为什么存在,然后引用你链接到的页面最相关的部分,以防目标页面不可用。