Any idea how can I add an Angular4 application as a content page in sitefinity cms?

心已入冬 提交于 2019-12-13 18:11:03

问题


I have a Web application implemented using Sitefinity CMS and I need to add an application implemented using angular4 inside it as a sub application. Angularjs is compiled as a JavaScript file so I'm trying to add a new Page on Sitefinity and place inside it the compiled JavaScript file but I get many errors related to packages installed on Angular.


回答1:


I would recommend you to build your application and add the build files as a dependency to use it in your CMS

For example if you use angular-cli, you can use the command

ng build -prod --output-hashing none

after doing this you will have files like

  • main.bundle.js
  • vendor.bundle.js
  • other ones

you can then import to an html in your cms to use it.




回答2:


First, I would use Sitefinity Feather to create a blank Page Template (assuming your html page contains all the needed static files like scripts and css).

Then, I would create a new Feather MVC widget that I can then go and drop on my Sitefinity Page (created based on the page template above).

The MVC widget will do nothing, simply returning the View.

Now in the View of the widget, you paste all your angular staff.



来源:https://stackoverflow.com/questions/45490634/any-idea-how-can-i-add-an-angular4-application-as-a-content-page-in-sitefinity-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!