ng-repeat在textarea中不起作用

时间:2022-12-02 20:33:35

The ng-repeat is not working inside a textarea. Any idea why? As soon as I moeve it outside the textarea, it works.

ng-repeat在textarea中不起作用。知道为什么吗?一旦我在textarea外面移动它,它就有效。

<textarea>
    <style ng-repeat="entry in bgTakeoverSettings.breakPoints">
      @media all and ({{entry.range}}: {{entry.bp}}px){
            {{bgTakeoverSettings.containerElements}}{
              width: {{entry.width - bgTakeoverSettings.padding * 2}}px;
            }

        }
    </style>
</textarea>

1 个解决方案

#1


0  

The content of a textarea is just arbitrary text. Therefore for the browser your ng-repeat is just plain text, and not as an instruction which it needs to process.

textarea的内容只是任意文本。因此,对于浏览器,ng-repeat只是纯文本,而不是它需要处理的指令。

It is still possible to generate mediaqueries by code as shown in this topic: Generating CSS media queries with javascript or jQuery

仍然可以通过代码生成媒体查询,如本主题所示:使用javascript或jQuery生成CSS媒体查询

#1


0  

The content of a textarea is just arbitrary text. Therefore for the browser your ng-repeat is just plain text, and not as an instruction which it needs to process.

textarea的内容只是任意文本。因此,对于浏览器,ng-repeat只是纯文本,而不是它需要处理的指令。

It is still possible to generate mediaqueries by code as shown in this topic: Generating CSS media queries with javascript or jQuery

仍然可以通过代码生成媒体查询,如本主题所示:使用javascript或jQuery生成CSS媒体查询