Quickstart: Angular
#
OverviewThis is a brief example how you can integrate Architect SDK into your existing angular application. If you want more comprehensive guide check out our phonebook app
#
Install Architect SDKInstall Architect SDK via:
- npm
- Yarn
You should see architect-sdk
dependency added to package.json file1.
#
Setup environmentIn your environment.ts file add this line:
After that environment.ts file should look like this:
Create new file called architectConfig.ts inside src folder. In order to take full advantage of our type system you should define resources type and pass them to architectSDK configuration. For example if you are making todo app
, you should define Todo
type and pass it to architectSDK like this:
You will now have full autocomplete for todos (and any additional resources you define) in editor of your choice.
#
Create architect SDK serviceType into your terminal following code
A new file called architect-sdk.service.ts should be in you app folder2. One of the ways you can add architectSDK in you service is:
With basic CRUD
operations architect-sdk.service.ts might look like this:
You can now inject ArchitectService into your component.
#
ConclusionIntegrating Architect SDK into your application is easy using simple steps provided above. If you want to see how small phonebook application utilises Architect SDK go and check link to tutorial. There you can see how authorization, CRUD operations and file upload can be handled in angular applications.