Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.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 angular1.x指令中单引号内的双引号无效_Javascript_Css_Angularjs - Fatal编程技术网

Javascript angular1.x指令中单引号内的双引号无效

Javascript angular1.x指令中单引号内的双引号无效,javascript,css,angularjs,Javascript,Css,Angularjs,我正在创建一个角度指令,如下所示,以在标题中显示徽标。背景图像没有出现,我怀疑这是因为单引号中的引号错误。谁能帮我修一下吗 angular.module("Common") .directive("mainHeader", [ function () { /// <summary>Markup for the main header section</summary>

我正在创建一个角度指令,如下所示,以在标题中显示徽标。背景图像没有出现,我怀疑这是因为单引号中的引号错误。谁能帮我修一下吗

angular.module("Common")
            .directive("mainHeader", [
                function () {
                    /// <summary>Markup for the main header section</summary>
                    return {
                        restrict: "E",
                        template: 
    '<header class="row"' +
        '<div class="col-md-12 logo-container">' +
            '<div class="logo" style="background:url(""/Content/Images/ey_login_logo.png""/) left top no-repeat;"></div>' +
        '</div>' +      
    '</header>'
                    };
                }
            ])
角度模块(“通用”) .directive(“main头”[ 函数(){ ///主标题部分的标记 返回{ 限制:“E”, 模板: ' 从
style
部分的
url
部分中删除双引号


style=“background:url(/Content/Images/ey\u login\u logo.png/)左上角不重复;”

此问题可以通过以下方法避免:

角度模块(“通用”) .指令(“mainHeader”,函数(){ ///主标题部分的标记 返回{ 限制:“E”, 模板:` . ` }; })
@RameshRajendran谢谢你。它worked@AlekseySolovey谢谢。这个问题可以通过使用来避免。我认为这只是一个打字错误,应该结束这个问题。
<div class="logo" style="background:url(" "="" content="" images="" ey_login_logo.png""="" )="" left="" top="" no-repeat;"=""></div>
angular.module("Common")
.directive("mainHeader", function () {
    /// <summary>Markup for the main header section</summary>
    return {
      restrict: "E",
      template:` 
.       <header class="row">
          <div class="col-md-12 logo-container">
            <div class="logo" style="background:url(/Content/Images/ey_login_logo.png) left top no-repeat;">
            </div>
          </div>
        </header>`
    };
})