简体   繁体   English

如何将Angular 6应用程序与WordPress主题集成?

[英]How to integrate Angular 6 app with WordPress theme?

I have already created a full project in WordPress but in that one section Alone I have developed in Angular 6 so now I have to integrate both. 我已经创建了一个完整的项目WordPress ,但在这一个部分Alone我已经开发了Angular 6所以我现在既整合。

Any hint or suggestion will be greatly appreciated it!! 任何提示或建议将不胜感激!

Instead of serving two separate code bases consider making the Angular App your main theme for a fully integrated experience. 与其提供两个单独的代码库,不如考虑将Angular应用作为您的主题,以获得完全集成的体验。

Using Xo for Angular you will be able to combine your existing theme with Angular and manage your Pages and Posts the same way you likely do now. 使用Xo for Angular,您将能够将现有主题与Angular结合,并以与现在相同的方式来管理Pages和Posts。 Xo provides an API which makes it easy to interact with your WordPress content, routes for pages and posts are then served dynamically to your Angular App. Xo提供了一个API,可轻松与WordPress内容进行交互,然后将页面和帖子的路由动态提供给Angular应用。

https://wordpress.org/plugins/xo-for-angular/ https://wordpress.org/plugins/xo-for-angular/

Check out the example theme at: https://github.com/WarriorRocker/angular-xo-material 在以下网址查看示例主题: https//github.com/WarriorRocker/angular-xo-material

Most pages will be mostly simple modules/components that can also utilize ACF fields if configured making custom options for a particular template a breeze. 大多数页面将主要是简单的模块/组件,如果配置后可以轻松使用特定模板的自定义选项,那么它们也可以利用ACF字段。

This provides a working example of a WordPress theme written fully in Angular that uses selectable templates, dynamic routes. 这提供了一个用Angular完全编写的WordPress主题的工作示例,该主题使用可选模板,动态路由。

Documentation (work in progress): https://angularxo.io/ 文档(正在进行中): https : //angularxo.io/

Plugin github: https://github.com/WarriorRocker/angular-xo-core 插件github: https : //github.com/WarriorRocker/angular-xo-core

Full disclosure I am the author of the above plugin and theme. 全面披露我是上述插件和主题的作者。

Let me know if you think this could work for you, thanks! 让我知道您是否认为这对您有用,谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM