Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
ulakbus-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ulakbus
ulakbus-ui
Commits
2320c175
Commit
2320c175
authored
Jun 18, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deep copy to use form diff, load general.js
parent
9afb4586
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
4 deletions
+15
-4
app_routes.js
app/app_routes.js
+3
-0
student_controller.js
app/components/student/student_controller.js
+4
-3
form_service.js
app/zetalib/forms/form_service.js
+1
-0
general.js
app/zetalib/general.js
+2
-0
fake_rest_server.js
fake_rest_server.js
+5
-1
No files found.
app/app_routes.js
View file @
2320c175
...
@@ -30,6 +30,9 @@ app.config(['$routeProvider', function ($routeProvider) {
...
@@ -30,6 +30,9 @@ app.config(['$routeProvider', function ($routeProvider) {
}],
}],
loadMyService
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
loadMyService
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
return
$ocLazyLoad
.
load
(
'zetalib/forms/form_service.js'
);
return
$ocLazyLoad
.
load
(
'zetalib/forms/form_service.js'
);
}],
loadMyService2
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
return
$ocLazyLoad
.
load
(
'zetalib/general.js'
);
}]
}]
}
}
})
})
...
...
app/components/student/student_controller.js
View file @
2320c175
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
* student module is base module object for student operations
* student module is base module object for student operations
*/
*/
var
student
=
angular
.
module
(
'zaerp.student.add'
,
[
'ngRoute'
,
'schemaForm'
,
'formService'
]);
var
student
=
angular
.
module
(
'zaerp.student.add'
,
[
'ngRoute'
,
'schemaForm'
,
'formService'
,
'general'
]);
/**
/**
* StudentAddCtrl
* StudentAddCtrl
...
@@ -23,7 +23,8 @@ student.controller('StudentAddEditCtrl', function($scope, $http, $log, Generator
...
@@ -23,7 +23,8 @@ student.controller('StudentAddEditCtrl', function($scope, $http, $log, Generator
$scope
.
schema
=
d
.
schema
;
$scope
.
schema
=
d
.
schema
;
$scope
.
form
=
d
.
form
;
$scope
.
form
=
d
.
form
;
// model is the init data of the form or in edit templates
// model is the init data of the form or in edit templates
$scope
.
model
=
{};
$scope
.
model
=
d
.
model
;
$scope
.
initialModel
=
angular
.
copy
(
d
.
model
);
// for email validation add asyncvalidator
// for email validation add asyncvalidator
$scope
.
form
[
0
].
$asyncValidators
=
Generator
.
asyncValidators
;
$scope
.
form
[
0
].
$asyncValidators
=
Generator
.
asyncValidators
;
// add submit button to the form todo: move this to form service
// add submit button to the form todo: move this to form service
...
@@ -38,7 +39,7 @@ student.controller('StudentAddEditCtrl', function($scope, $http, $log, Generator
...
@@ -38,7 +39,7 @@ student.controller('StudentAddEditCtrl', function($scope, $http, $log, Generator
$scope
.
$broadcast
(
'schemaFormValidate'
);
$scope
.
$broadcast
(
'schemaFormValidate'
);
if
(
form
.
$valid
)
{
if
(
form
.
$valid
)
{
// todo: implement form diff here
// todo: implement form diff here
$log
.
info
(
$scope
);
$log
.
info
(
$scope
.
initialModel
,
$scope
.
model
);
}
}
}
}
});
});
\ No newline at end of file
app/zetalib/forms/form_service.js
View file @
2320c175
...
@@ -34,6 +34,7 @@ form_generator.factory('Generator', function ($http, $q, $timeout, RESTURL) {
...
@@ -34,6 +34,7 @@ form_generator.factory('Generator', function ($http, $q, $timeout, RESTURL) {
// todo: remove 0 index with real api
// todo: remove 0 index with real api
return
generator
.
generate
(
res
.
data
[
0
]);
return
generator
.
generate
(
res
.
data
[
0
]);
}
}
// todo: cover all other exceptions (4xx, 5xx)
});
});
};
};
generator
.
isValidEmail
=
function
(
email
){
generator
.
isValidEmail
=
function
(
email
){
...
...
app/zetalib/general.js
View file @
2320c175
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
* (GPLv3). See LICENSE.txt for details.
* (GPLv3). See LICENSE.txt for details.
*/
*/
// todo: move to form
//angular.module('FormDiff', [])
//angular.module('FormDiff', [])
/**
/**
* this file contains general functions of app.
* this file contains general functions of app.
...
...
fake_rest_server.js
View file @
2320c175
...
@@ -36,7 +36,11 @@ var form = new fake.Resource("add_student")
...
@@ -36,7 +36,11 @@ var form = new fake.Resource("add_student")
}
}
},
},
"name"
"name"
]
],
model
:
{
name
:
"evren kutar"
,
email
:
"a@a.com"
}
});
});
var
server
=
new
fake
.
Server
()
var
server
=
new
fake
.
Server
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment