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
7b2bdf68
Commit
7b2bdf68
authored
Jun 30, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
staff controller name fix
staff controller test file
parent
0605cce7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
5 deletions
+30
-5
app_routes.js
app/app_routes.js
+1
-1
staff_controller.js
app/components/staff/staff_controller.js
+2
-4
staff_controller_test.js
app/components/staff/staff_controller_test.js
+27
-0
No files found.
app/app_routes.js
View file @
7b2bdf68
...
...
@@ -68,7 +68,7 @@ app.config(['$routeProvider', function ($routeProvider) {
})
.
when
(
'/staff/add'
,
{
templateUrl
:
'components/staff/staff_add_template.html'
,
controller
:
'StaffCtrl'
,
controller
:
'Staff
AddEdit
Ctrl'
,
resolve
:
{
loadMyCtrl
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
return
$ocLazyLoad
.
load
(
'components/staff/staff_controller.js'
);
...
...
app/components/staff/staff_controller.js
View file @
7b2bdf68
...
...
@@ -8,7 +8,7 @@
'use strict'
;
var
staff
=
angular
.
module
(
'zaerp.staff
.add
'
,[
'ngRoute'
,
'schemaForm'
,
'formService'
]);
var
staff
=
angular
.
module
(
'zaerp.staff'
,[
'ngRoute'
,
'schemaForm'
,
'formService'
]);
/**
...
...
@@ -16,7 +16,7 @@ var staff = angular.module('zaerp.staff.add',['ngRoute','schemaForm', 'formServi
* which provide a form with form generator.
*/
staff
.
controller
(
'StaffCtrl'
,
function
(
$scope
,
$http
,
$log
,
Generator
,
$routeParams
){
staff
.
controller
(
'Staff
AddEdit
Ctrl'
,
function
(
$scope
,
$http
,
$log
,
Generator
,
$routeParams
){
Generator
.
get_form
(
'add_staff'
,
$routeParams
).
then
(
function
(
d
){
$scope
.
schema
=
d
.
schema
;
$scope
.
form
=
d
.
form
;
...
...
@@ -28,7 +28,6 @@ staff.controller('StaffCtrl', function($scope, $http, $log, Generator, $routePar
title
:
"Save"
}
);
});
$scope
.
onSubmit
=
function
(
form
){
$scope
.
$broadcast
(
'schemaFormValidate'
);
...
...
@@ -37,5 +36,4 @@ staff.controller('StaffCtrl', function($scope, $http, $log, Generator, $routePar
$log
.
info
(
$scope
);
}
}
});
\ No newline at end of file
app/components/staff/staff_controller_test.js
0 → 100644
View file @
7b2bdf68
/**
* Copyright (C) 2015 ZetaOps Inc.
*
* This file is licensed under the GNU General Public License v3
* (GPLv3). See LICENSE.txt for details.
*/
'use strict'
;
describe
(
'staff controller module'
,
function
()
{
var
$controller
;
beforeEach
(
inject
(
function
(
_$controller_
)
{
// The injector unwraps the underscores (_) from around the parameter names when matching
$controller
=
_$controller_
;
}));
describe
(
'staff add controller'
,
function
()
{
it
(
'should have a scope object'
,
inject
(
function
()
{
expect
(
$scope
).
toBeDefined
();
}));
it
(
'should get form'
,
inject
(
function
()
{
expect
(
$scope
.
form
).
not
.
toBe
(
null
);
}));
});
});
\ No newline at end of file
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