Skip to content

Commit ea832dd

Browse files
committed
Add in-ASF include
1 parent 0064cd6 commit ea832dd

File tree

5 files changed

+28
-10
lines changed

5 files changed

+28
-10
lines changed

angular-schema-form-complex-ui.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
angular.module("schemaForm").run(["$templateCache", function($templateCache) {$templateCache.put("directives/decorators/bootstrap/complex-ui/angular-schema-form-complex-ui.html","<div ng-class=\"{\'has-error\': hasError()}\"><div ng-init=\"controller.model=$$value$$\" complex-ui-directive=\"\"><div ng-if=\"form.options.showButton == true\"><label>{{form.title}}</label>&nbsp;<button ng-click=\"controller.toggleModal()\">{{form.options.buttonCaption}}</button><modal title=\"{{form.title}}\" visible=\"showModal\"><div ng-if=\"form.options.sourceInclude != \'\'\"><ng-include src=\"form.options.sourceInclude\"></ng-include></div><div ng-if=\"form.options.sourceInclude == null\"><div name=\"\" sf-schema=\"controller.schema\" sf-form=\"controller.form\" sf-model=\"controller.model\"></div></div></modal></div><div ng-if=\"form.options.showButton != true\"><label ng-show=\"showTitle()\">{{form.title}}</label><div name=\"\" sf-schema=\"controller.schema\" sf-form=\"controller.form\" sf-model=\"controller.model\"></div></div></div><span class=\"help-block\">{{ (hasError() && errorMessage(schemaError())) || form.description}}</span><br><span ng-show=\"form.some_setting\">The some setting-setting is true for the model at $$value$$!</span></div>");}]);
1+
angular.module("schemaForm").run(["$templateCache", function($templateCache) {$templateCache.put("directives/decorators/bootstrap/complex-ui/angular-schema-form-complex-ui.html","<div ng-class=\"{\'has-error\': hasError()}\"><div ng-init=\"controller.model=$$value$$\" complex-ui-directive=\"\"><div ng-if=\"form.options.showButton == true\"><label>{{form.title}}</label>&nbsp;<button ng-click=\"controller.toggleModal()\">{{form.options.buttonCaption}}</button><modal title=\"{{form.title}}\" visible=\"showModal\"><div ng-if=\"form.options.sourceInclude != \'\'\"><ng-include src=\"form.options.sourceInclude\"></ng-include></div><div ng-if=\"form.options.sourceInclude == null\"><div name=\"\" sf-schema=\"controller.schema\" sf-form=\"controller.form\" sf-model=\"controller.model\"></div></div></modal></div><div ng-if=\"form.options.showButton != true\"><label ng-show=\"showTitle()\">{{form.title}}</label><div ng-if=\"form.options.sourceInclude != \'\'\"><ng-include src=\"form.options.sourceInclude\"></ng-include></div><div ng-if=\"form.options.sourceInclude == null\"><div name=\"\" sf-schema=\"controller.schema\" sf-form=\"controller.form\" sf-model=\"controller.model\"></div></div></div></div><span class=\"help-block\">{{ (hasError() && errorMessage(schemaError())) || form.description}}</span><br><span ng-show=\"form.some_setting\">The some setting-setting is true for the model at $$value$$!</span></div>");}]);
22
/// <reference path="../typings/angularjs/angular.d.ts" />
33
/// <reference path="../typings/jquery/jquery.d.ts" />
44
angular.module('schemaForm').config(['schemaFormProvider',
@@ -12,9 +12,6 @@ var ComplexUIController = (function () {
1212
function ComplexUIController($scope, element) {
1313
var _this = this;
1414
this.$scope = $scope;
15-
this.alertObj = function (obj) {
16-
window.alert(JSON.stringify(obj));
17-
};
1815
this.toggleModal = function () {
1916
this.directiveScope.showModal = !this.directiveScope.showModal;
2017
};

angular-schema-form-complex-ui.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,26 @@ <h1>Complex UI</h1>
3030

3131
<p>This is an example of an <a href="https://github.com/Textalk/angular-schema-form/">angular-schema-form</a> add-on.</p>
3232

33+
<h3>Angular schema form with a nested ASF or a specified include</h3>
34+
35+
3336
<form name="selectForm" sf-schema="schema" sf-form="form" sf-model="model" ng-submit="submitted(selectForm)"></form>
37+
<h3>Settings</h3>
38+
<p>Show button <input type="checkbox" ng-model="form[0]['options']['showButton']" ng-click="$broadcast('schemaFormRedraw')"></p>
39+
<p>Use include <input type="text" ng-model="form[0]['options']['sourceInclude']" ng-click="$broadcast('schemaFormRedraw')"></p>
40+
41+
<h3>Master schema and form</h3>
42+
<hr>
43+
<p>The main schema is at controller.complexSchema, it is currently:</p>
44+
<pre>{{schema| json : spacing}}</pre>
45+
<p>The main form is just form. Currently the form has the following values:</p>
46+
<pre>{{form| json : spacing}}</pre>
47+
<h3>Nested schema and form</h3>
48+
<hr>
49+
<p>The main schema is at controller.complexSchema, it is currently:</p>
50+
<pre>{{resolveReference()["schema"]| json : spacing}}</pre>
51+
<p>The main form is just form. Currently the form has the following values:</p>
52+
<pre>{{resolveReference()["form"]| json : spacing}}</pre>
53+
3454
</body>
3555
</html>

src/angular-schema-form-complex-ui.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@
3030
<div ng-if="form.options.showButton != true">
3131
<label ng-show="showTitle()">{{form.title}}</label>
3232
<!-- Add the schema for, not by using a form tag but a div, as forms cannot be nested. -->
33-
<div name="" sf-schema="controller.schema" sf-form="controller.form" sf-model="controller.model"></div>
33+
<div ng-if="form.options.sourceInclude != ''">
34+
<ng-include src="form.options.sourceInclude"></ng-include>
35+
</div>
36+
<div ng-if="form.options.sourceInclude == null">
37+
<div name="" sf-schema="controller.schema" sf-form="controller.form" sf-model="controller.model"></div>
38+
</div>
3439
</div>
3540

3641
</div>

src/angular-schema-form-complex-ui.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ class ComplexUIController {
3232

3333
$broadcast:any;
3434

35-
alertObj = (obj) => {
36-
window.alert(JSON.stringify(obj));
37-
};
38-
3935
toggleModal = function () {
4036
this.directiveScope.showModal = !this.directiveScope.showModal;
4137
};

0 commit comments

Comments
 (0)