mmlpx-angularjs
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

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')
	});

Dependencies (0)

    Dev Dependencies (8)

    Package Sidebar

    Install

    npm i mmlpx-angularjs

    Weekly Downloads

    2

    Version

    0.0.4

    License

    none

    Unpacked Size

    4.53 kB

    Total Files

    6

    Last publish

    Collaborators

    • kuitos