I want to integrate AngularJS2 in Magnolia CMS (I'm new to AngularJS). I tried the quickstart Project localy it works correctly with npm start.
I used npm tsc to get the .js file to use those in Magnolia for testing if it works. All the node_modules files i got over unpkg.com (I locked up in the terminal which files where used for the quickstart project and integrated all of them). Adding the <my-app>
tag in an ftl template and all the scripts at the same place (the App-js files are loaded from magnolia itselfs). This didn't worked, so I do not know what I'm missing.
I also tried to do something similar to this one (but with use @angular instead of angular2 beta).
I'm not sure if this is possible to do like this, since the Quickstart works (with npm start) but on my tomcat server it doesn't. I thought that the problem may be the tomcat server.
I also tried it without any server just with this code snipped, where the structure was as follow:
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>
But this also didnt worked.
I've a REST API to get an Validator for a formular and other stuff. But now I need to build a page for the formular. I've no idea how I could build this page. Is it possible to do it inside Magnolia with ftl? What's the best solution here