-
Notifications
You must be signed in to change notification settings - Fork 3
Angular JS Environment
GeoPrism uses the cargo-run launch to start a local dev server. To develop in a local Angular 2+ environment you must:
- make sure ng2-dev is added to the list of profiles in the launch.
- CD into the geoprism/geoprism-web/src/main/ng2 dirctory and run 'npm run build'.
This should result in your Angular 2+ source being read on localhost so you can see changes without having to restart the server.
IMPORTANT NOTE: After the server is started and you visit the app you will likely get errors saying polyfills.js, vendor.js, app.js can't be found. This is due to a cross domain restriction. To fix it right click on the error file in the console and copy the link address. Past the link address into a new tab. You're trying to open the file directly. This will give you a security warning which you need to accept as an allowed exception. Once done your browser session will register https://localhost as safe and the page should work.
In general, our maven tasks should automatically compile the ng2 source. If for some reason you need to compile it manually, here's how you can from command line:
- Install nodejs (should come with npm)
- cd to the ng2 directory in you web project
- From command line run
npm install
. This will automatically pull all our project's dependencies using the npm package manager. - Install typings:
sudo npm install typings --global
- Install lodash into typings:
typings install lodash
- You can now compile the angular source code with
npm run build