Angular¶
The Angular seed app is the same application as the React one, in Angular: ng new under the hood, the SASjs Adapter configured, a login screen, and a SAS backend in the same repository.
Source: sasjs/angular-seed-app.
What you get¶
my-app/
├── sasjs/ <- the backend, exactly as in the React seed
│ ├── sasjsconfig.json
│ ├── services/common/
│ └── macros/
├── src/app/
│ ├── sasjs/ <- the adapter instance and its Angular service
│ └── components/ <- including the SAS login form
└── angular.json
The adapter is wrapped in an injectable service, so a component asks for data rather than for SAS:
Develop¶
npm start # ng serve, on localhost:4200
sasjs cbd -t myTarget # compile, build and deploy the services it calls
Deploy¶
sasjs cbd -t myTarget # the services
sasjs web -t myTarget # the front end, packaged as a streaming app
sasjs deploy -t myTarget # both, into the target
Two Angular-specific notes:
- remove
<base href="/">fromsrc/index.htmlif the app is deployed under a subfolder of the SAS server, or the router will resolve against the domain root; ng build --prodwrites todist/, which is whatstreamConfig.webSourcePathshould point at.
Next¶
- Services - the backend the app calls.
- Frontend deployment - the options for serving the built app.
- Adapter documentation - the full request, auth and file API.