问题
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