【发布时间】:2017-06-26 02:11:35
【问题描述】:
我想将 AngularJS2 集成到 Magnolia CMS 中(我是 AngularJS 的新手)。 我尝试了quickstart Project localy,它与 npm start 一起正常工作。
我使用 npm tsc 获取 .js 文件以使用 Magnolia 中的文件来测试它是否有效。我从 unpkg.com 获得的所有 node_modules 文件(我在终端中锁定了哪些文件用于快速启动项目并集成了所有文件)。在 ftl 模板中添加 <my-app> 标记并将所有脚本添加到同一位置(App-js 文件是从 magnolia 本身加载的)。这没有用,所以我不知道我错过了什么。
我也尝试做类似于this 的事情(但使用@angular 而不是angular2 beta)。
我不确定是否可以这样做,因为快速入门可以工作(使用 npm start),但在我的 tomcat 服务器上却不行。我以为问题可能出在tomcat服务器上。
我也试过没有任何服务器,只是剪掉这段代码,结构如下:
test/test.html
test/app/app.component.js & app.module.js & main.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!-- Update these package versions as needed -->
<script src="https://unpkg.com/zone.js@0.7.6/dist/zone.js"></script>
<script src="https://unpkg.com/systemjs@0.20.5/dist/system.src.js"></script>
<script src="https://unpkg.com/core-js@2.4.1/client/shim.min.js"></script>
<script src="https://unpkg.com/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js"></script>
<script src="https://unpkg.com/@angular/platform-browser/bundles/platform-browser.umd.js"></script>
<script src="https://unpkg.com/@angular/core/bundles/core.umd.js"></script>
<script src="https://unpkg.com/@angular/common/bundles/common.umd.js"></script>
<script src="https://unpkg.com/@angular/compiler/bundles/compiler.umd.js"></script>
<script src="https://unpkg.com/rxjs/symbol/observable.js"></script>
<script src="https://unpkg.com/rxjs/Observable.js"></script>
<script src="https://unpkg.com/rxjs/Subject.js"></script>
<script src="https://unpkg.com/rxjs/util/root.js"></script>
<script src="https://unpkg.com/rxjs/util/toSubscriber.js"></script>
<script src="https://unpkg.com/rxjs/Subscriber.js"></script>
<script src="https://unpkg.com/rxjs/Subscription.js"></script>
<script src="https://unpkg.com/rxjs/util/ObjectUnsubscribedError.js"></script>
<script src="https://unpkg.com/rxjs/SubjectSubscription.js"></script>
<script src="https://unpkg.com/rxjs/symbol/rxSubscriber.js"></script>
<script src="https://unpkg.com/rxjs/Observer.js"></script>
<script src="https://unpkg.com/rxjs/util/isFunction.js"></script>
<script src="https://unpkg.com/rxjs/util/isArray.js"></script>
<script src="https://unpkg.com/rxjs/util/isObject.js"></script>
<script src="https://unpkg.com/rxjs/util/tryCatch.js"></script>
<script src="https://unpkg.com/rxjs/util/errorObject.js"></script>
<script src="https://unpkg.com/rxjs/util/UnsubscriptionError.js"></script>
<script src="app/app.component.js"></script>
<script src="app/app.module.js"></script>
<script src="app/main.js"></script>
<script>
System.import('app').catch(function(err){ console.error(err); });
</script>
<title>Title</title>
</head>
<body>
<my-app>Loading AppComponent content here ...</my-app>
</body>
</html>
但这也没有用。
我有一个 REST API 来获取公式和其他东西的验证器。但现在我需要为公式建立一个页面。我不知道如何构建此页面。是否可以使用 ftl 在 Magnolia 内部进行操作? 这里最好的解决方案是什么
【问题讨论】:
标签: maven angular tomcat magnolia