This is a TodoMVC project that shows how SAM Pattern can be implemented in a typical Angular application.
It demonstrates scenarios you will find in a typical web application: handling user input, (reactive) computed properties, and asynchronous operations like calling a remote API.
The idea is to make it as "Angular-like" as possible so that it is accessible for a typical Angular developer.
In this spirit we used Angular CLI to generate the project, RxJS to create a reactive loop and Typescript.
You do not need a complex framework to use SAM Pattern. The core is only ~40 lines of Typescript (See initializeSAM.ts).
The rest is about how you use familiar concepts from Angular, Typescript and RxJS:
- Actions and State: src/app/app.component.ts
- Model: src/app/model
- State representation: src/app/state-representation
- View: src/app/todo-body/todo-body.component.ts, src/app/todo-header/todo-header.component.ts and src/app/todo-footer/todo-footer.component.ts