Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

SenseNet/sn-angular2-redux-todo-app

Repository files navigation

Todo App example with SN7, Angular2 and Redux


This package is not under active development. You can find our latest packages in the sensenset/sn-client monorepo.


Greenkeeper badge

Build status License Commitizen friendly

This example is simple todo app built with Angular2+Redux upon Sense/Net ECM which has been prepared to demonstrate how to use the new sensenet ECM related libraries sn-client-js and sn-redux.

Quick start

$ git clone https://github.com/SenseNet/sn-angular2-redux-todo-app.git
$ cd sn-angular2-redux-todo-app
$ npm install
$ npm run start

Settings

To use this example you'll need a sensenet ECM portal. To connect the app with the portal set your site's url as the app's siteUrl

import { SetSiteUrl } from 'sn-client-js';

SetSiteUrl('https://mysite.com');

Go to your portal's Portal.setting (/Root/System/Settings/Portal.settings) and check the allowed origins. To get the app working you have to add the app's domain as an allowed origin so that the app can send requests to the portal and get or set data.

{
   AllowedOriginDomains: [ "localhost" ]
}

For further information about CORS in sensenet ECM check this article.

The example app uses one of the built-in TaskList Content in the default sensenet ECM install (/workspaces/Project/budapestprojectworkspace/Tasks). If you removed this Content and its children tasks earlier or want to try with another TaskList change the value of the path variable of SnTodoListComponent in app.component.ts to the chosen list's path.

The example app demonstrates not only how to fetching data but also Content creation and delete. The app doesn't provide authentication because of it's simplicity so you have to make some permission changes in your sensenet ECM portal to let Visitor users adding and removing tasks from the chosen parent list. If you are not familiar with Sense/Net's permission system check the following wiki articles:

Related documents

This project was generated with angular-cli version 1.0.0-beta.24.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive/pipe/service/class/module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the -prod flag for a production build.

Further help

To get more help on the angular-cli use ng help or go check out the Angular-CLI README.