a model component for angularjs