Implementing SAM pattern (http://sam.js.org/) in an Angular application
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
backend
e2e
src
.angular-cli.json
.editorconfig
.gitignore
README.md
karma.conf.js
package.json
protractor.conf.js
proxy.conf.json
tsconfig.json
tslint.json

README.md

TodoSam

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.

Introduction

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: