[Templates] Simplify MCTToolbar

Use mct-form as a basis; simply change the template.
This commit is contained in:
Victor Woeltjen 2016-02-26 15:17:31 -08:00
parent 2d03e3e6d4
commit 596735352a

View File

@ -25,8 +25,8 @@
* Module defining MCTForm. Created by vwoeltje on 11/10/14. * Module defining MCTForm. Created by vwoeltje on 11/10/14.
*/ */
define( define(
["./controllers/FormController", "text!../res/templates/toolbar.html"], ["./MCTForm", "text!../res/templates/toolbar.html"],
function (FormController, toolbarTemplate) { function (MCTForm, toolbarTemplate) {
"use strict"; "use strict";
/** /**
@ -49,32 +49,14 @@ define(
* @memberof platform/forms * @memberof platform/forms
* @constructor * @constructor
*/ */
function MCTForm() { function MCTToolbar() {
return { // Use Directive Definition Object from mct-form,
// Only show at the element level // but use the toolbar's template instead.
restrict: "E", var ddo = new MCTForm();
ddo.template = toolbarTemplate;
// Load the forms template return ddo;
template: toolbarTemplate,
// Use FormController to populate/respond to changes in scope
controller: [ '$scope', FormController ],
// Initial an isolate scope
scope: {
// The model: Where form input will actually go
ngModel: "=",
// Form structure; what sections/rows to show
structure: "=",
// Name under which to publish the form
name: "@"
}
};
} }
return MCTForm; return MCTToolbar;
} }
); );