我使用electron-forge using the angular2 template设置了一个新项目。一切正常,但后来我尝试将组件模板移动到单独的HTML文件中。
我只是从<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class='container'>
<div class="row contain">
<div class="col-sm-4 A">1</div>
<div class="col-sm-4 B">2</div>
<div class="col-sm-4 three">
<div class="row">
<div class="col-sm-12 C">3</div>
<div class="col-sm-12 D">4</div>
</div>
</div>
</div>
</div>
获取了示例HTML,将其粘贴到同一目录中的新app.component.ts
并更改了组件中...
app.component.html
到..
template: `<h1>template content</h1>`
当我现在运行时,我收到错误:
templateUrl: './app.component.html'
和启动的电子窗口只显示有关无法编译新模板HTML的错误消息。
是否需要使用外部模板进行一些配置?或者我错过了一些明显的东西?
当/如果我解决了这个问题,我是否会遇到使用Couldn't set selectedTextBackgroundColor from default ()
添加外部样式表的类似问题?
任何建议都乐意接受。创造一个电子/角度应用程序的前景让我孩子般的喜悦在今天被无法完成任何工作而慢慢压垮。
提前致谢!
答案 0 :(得分:0)
尝试使用npm run watch编译项目(如果使用npm),在laravel中为我工作过,
如果不使用npm,则必须再次编译模板
祝你好运