Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```