Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/youngmonkeys/mvc.js
mvc for javascript, support for event-driven
https://github.com/youngmonkeys/mvc.js
event-dispatcher event-driven event-handler mvc mvc-javascript
Last synced: 8 days ago
JSON representation
mvc for javascript, support for event-driven
- Host: GitHub
- URL: https://github.com/youngmonkeys/mvc.js
- Owner: youngmonkeys
- License: apache-2.0
- Created: 2019-01-14T14:54:18.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-13T16:59:27.000Z (almost 5 years ago)
- Last Synced: 2024-09-27T14:07:42.502Z (about 2 months ago)
- Topics: event-dispatcher, event-driven, event-handler, mvc, mvc-javascript
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mvc.js
mvc for javascript# Synopsis
mvc for javascript
# Code Example
**1. Add a new controller**
```javascript
let mvc = Mvc.getInstance();
mvc.newController("login");
```**2. Add a view**
```javascript
var loginController = mvc.getController("login");
loginController.addDefaultView('access-app', (data) => {
console.log(JSON.stringify(data));
});
```**3. Update a view**
```javascript
var loginController = mvc.getController("login");
loginController.updateViews("access-app", {success: true});
```# Installation
for es6:
```
npm i mvc-es6
```