Skip to content

Commit ec0527e

Browse files
committed
first working directive encapsulation
1 parent 7935e26 commit ec0527e

File tree

8 files changed

+494
-7
lines changed

8 files changed

+494
-7
lines changed

app/app-controller.es6

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
angular.module('schemaFormBuilderApp').controller('FormBuilderController',function ($scope) {
2+
// JSON Schema
3+
// add an existing schema to edit it
4+
// or leave blank to create a new form
5+
$scope.schema = {};
6+
7+
// Schema Form Defintion
8+
// add an existing form definition for editing
9+
// or leave blank to create a new form
10+
$scope.form = [];
11+
12+
13+
$scope.model = {
14+
name: 'Sample Form',
15+
type: 'schema-form',
16+
fields: [
17+
{
18+
type: 'text',
19+
key: 'first_name',
20+
title: 'First name',
21+
open: false
22+
},
23+
{
24+
type: 'text',
25+
key: 'last_name',
26+
title: 'Last name',
27+
open: false
28+
},
29+
{
30+
type: 'email',
31+
key: 'email',
32+
title: 'Email',
33+
open: false,
34+
showAdvance: true,
35+
fieldAddonRight:'<i class="glyphicon glyphicon-envelope"></i>'
36+
},
37+
{
38+
type: 'date',
39+
key: 'dob',
40+
title: 'Date of Birth',
41+
open: false
42+
},
43+
{
44+
type: 'dropdown',
45+
key: 'marital-status',
46+
title: 'Marital Status',
47+
open: false
48+
},
49+
{
50+
type: 'date-time',
51+
key: 'check-in',
52+
title: 'Check In',
53+
open: false
54+
},
55+
{
56+
type: 'date-time',
57+
key: 'check-out',
58+
title: 'Check Out',
59+
open: false
60+
},
61+
{
62+
type: 'textarea',
63+
key: 'bio',
64+
title: 'Biography',
65+
open: false
66+
}
67+
]
68+
};
69+
});

app/app-module.es6

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
'use strict';
33

44
/* @ngdoc object
5-
* @name schemaFormBuilder
5+
* @name schemaFormBuilderApp
66
* @description
77
*
88
*/
99
angular
10-
.module('schemaFormBuilder', [
10+
.module('schemaFormBuilderApp', [
1111
'builder',
1212
'ui.bootstrap'
1313
]);

app/app-routes.es6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
'use strict';
33

44
angular
5-
.module('schemaFormBuilder')
5+
.module('schemaFormBuilderApp')
66
.config(config);
77

88
function config($urlRouterProvider) {

app/builder/controllers/builder-controller.es6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
'use strict';
33

44
class BuilderCtrl {
5-
constructor(Converter, $scope, $uibModal) {
5+
constructor(Converter, $scope) {
66
let vm = this;
77

88
// sample form

0 commit comments

Comments
 (0)