export supportedFields in injector
This commit is contained in:
parent
4577c7d2cf
commit
864f75837a
|
@ -117,6 +117,7 @@ module.exports = function(db) {
|
||||||
app.use(cookieParser());
|
app.use(cookieParser());
|
||||||
|
|
||||||
// Express MongoDB session storage
|
// Express MongoDB session storage
|
||||||
|
|
||||||
app.use(session({
|
app.use(session({
|
||||||
saveUninitialized: true,
|
saveUninitialized: true,
|
||||||
resave: true,
|
resave: true,
|
||||||
|
|
|
@ -7,12 +7,14 @@ services:
|
||||||
build: .
|
build: .
|
||||||
volumes:
|
volumes:
|
||||||
- .:/usr/src/app
|
- .:/usr/src/app
|
||||||
|
command: node server.js
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
- "35729:35729"
|
- "35729:35729"
|
||||||
environment:
|
environment:
|
||||||
DB_1_PORT_27017_TCP_ADDR: db
|
DB_1_PORT_27017_TCP_ADDR: db
|
||||||
PORT: 3000
|
PORT: 3000
|
||||||
|
BASE_URL: http://192.168.99.100:3000/
|
||||||
links:
|
links:
|
||||||
- db
|
- db
|
||||||
volumes:
|
volumes:
|
||||||
|
|
|
@ -27,3 +27,19 @@ function(){
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
angular.module('forms').value('supportedFields', [
|
||||||
|
'textfield',
|
||||||
|
'textarea',
|
||||||
|
'date',
|
||||||
|
'dropdown',
|
||||||
|
'hidden',
|
||||||
|
'password',
|
||||||
|
'radio',
|
||||||
|
'legal',
|
||||||
|
'statement',
|
||||||
|
'rating',
|
||||||
|
'yes_no',
|
||||||
|
'number',
|
||||||
|
'natural'
|
||||||
|
]);
|
||||||
|
|
|
@ -8,8 +8,8 @@ var __indexOf = [].indexOf || function(item) {
|
||||||
return -1;
|
return -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
angular.module('forms').directive('fieldDirective', ['$http', '$compile', '$rootScope', '$templateCache',
|
angular.module('forms').directive('fieldDirective', ['$http', '$compile', '$rootScope', '$templateCache', 'supportedFields',
|
||||||
function($http, $compile, $rootScope, $templateCache) {
|
function($http, $compile, $rootScope, $templateCache, supportedFields) {
|
||||||
|
|
||||||
var getTemplateUrl = function(fieldType) {
|
var getTemplateUrl = function(fieldType) {
|
||||||
var type = fieldType;
|
var type = fieldType;
|
||||||
|
@ -29,7 +29,7 @@ angular.module('forms').directive('fieldDirective', ['$http', '$compile', '$root
|
||||||
'number',
|
'number',
|
||||||
'natural'
|
'natural'
|
||||||
];
|
];
|
||||||
if (__indexOf.call(supported_fields, type) >= 0) {
|
if (__indexOf.call(supportedFields, type) >= 0) {
|
||||||
templateUrl = templateUrl+type+'.html';
|
templateUrl = templateUrl+type+'.html';
|
||||||
}
|
}
|
||||||
return $templateCache.get('../public/'+templateUrl);
|
return $templateCache.get('../public/'+templateUrl);
|
||||||
|
|
Loading…
Reference in a new issue