将Laravel 5与AngularJS刀片标签冲突

imperium2335

我正在尝试使用Laravel 5设置Angular。

我尝试在appServiceProvider中进行以下操作:

public function boot()
{
    \Blade::setRawTags("[[", "]]");
    \Blade::setContentTags('<%', '%>'); // for variables and all things Blade
    \Blade::setEscapedContentTags('<%%', '%%>'); // for escaped data
}

带有:

<div>
  <input type="text" ng-model="yourName" placeholder="Enter a name here">
  <h1>Hello, {{ yourName }}!</h1>
</div>

但是我得到了:

Use of undefined constant yourName - assumed 'yourName'...
Lukasgeiter

在进行与Blade有关的更改(扩展Blade,更改标签等)时,请务必确保删除缓存的视图。

它们位于中storage/framework/views

只需删除所有文件(除外.gitignore

如果您想要更实用的东西,可以创建一个命令来完成。这个

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章