Skip to content

mmlpxjs/mmlpx-angularjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mmlpx-angularjs

mmlpx connector to angularjs

Installing

npm i mmlpx-angularjs -S

Usage

import { ViewModel, postConstruct } from 'mmlpx';
import { connect } from 'mmlpx-angularjs';
import { observable, observe } from 'mobx';
import ngMobx from 'mobx-angularjs';


@ViewModel
class UserViewModel {

	@observable
	id = null;

	contructor($element) {
    	this.$element = $element;
	}

	@postConstruct
	onInit() {
		observe(this, 'id', changedValue => this.store.fetchUsers(changedValue))
	}
}

angular
	.module('app', [ngMobx])
	.component('container', {
		template: '<div mobx-autorun>{{$ctrl.id}}</div>'
		controller: connect(UserViewModel, '$element')
	});

About

🚚 mmlpx connector to angularjs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published