Golang和AngularJS模板冲突 [英] Golang and AngularJS template conflict
问题描述
我与golang html / template和angularjs分隔符有冲突。我知道有一种方法可以在Go中更改分隔符,但它不适用于我。也许应该在解析文件之前调用它?你能举个例子,说明它应该如何实现。
我发现很多AngularJS和Go应该没有冲突的评论,因为它们应该分开使用。据我所知,Go应该只用于后端(REST)。问题是,应该如何加载AngularJS,HTML?在这种情况下,我需要服务器吗?
template.Execute
)服务AngularJS html文件时,您只需提供静态内容。 I have a conflict with golang html/template and angularjs delimiters. I know that there is a method that lets to change delimiter in Go, but it does not work for me. Maybe it should be called before parsing of files? Could you please provide an example, how it should be implemented.
I found a lot of comments that AngularJS and Go should not have any conflict because they should be used separately. As I understand, Go should be used only for backend (REST). The question is, how AngularJS, HTML should be loaded? In this case, should I have to servers?
The idea behind AngularJS is to have all the rendering process run on the client side.
If you follow this logic all along, you do not need any rendering on the server side (e.g : no call to template.Execute
) when serving AngularJS html files, you simply have to serve static content.
这篇关于Golang和AngularJS模板冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!