add public prefix to html2js conf
This commit is contained in:
parent
1ddf23a848
commit
42e9b7564e
|
@ -227,7 +227,7 @@ module.exports = function(grunt) {
|
||||||
},
|
},
|
||||||
html2js: {
|
html2js: {
|
||||||
options: {
|
options: {
|
||||||
base: 'NodeForm',
|
base: 'public',
|
||||||
watch: true,
|
watch: true,
|
||||||
module: 'NodeForm.templates',
|
module: 'NodeForm.templates',
|
||||||
singleModule: true,
|
singleModule: true,
|
||||||
|
|
|
@ -10,7 +10,7 @@ var __indexOf = [].indexOf || function(item) {
|
||||||
|
|
||||||
angular.module('forms').directive('fieldDirective', ['$http', '$compile', '$rootScope', '$templateCache',
|
angular.module('forms').directive('fieldDirective', ['$http', '$compile', '$rootScope', '$templateCache',
|
||||||
function($http, $compile, $rootScope, $templateCache) {
|
function($http, $compile, $rootScope, $templateCache) {
|
||||||
|
|
||||||
var getTemplateUrl = function(fieldType) {
|
var getTemplateUrl = function(fieldType) {
|
||||||
var type = fieldType;
|
var type = fieldType;
|
||||||
var templateUrl = 'modules/forms/views/directiveViews/field/';
|
var templateUrl = 'modules/forms/views/directiveViews/field/';
|
||||||
|
@ -33,7 +33,7 @@ angular.module('forms').directive('fieldDirective', ['$http', '$compile', '$root
|
||||||
templateUrl = templateUrl+type+'.html';
|
templateUrl = templateUrl+type+'.html';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $templateCache.get('../public/'+templateUrl);
|
return $templateCache.get(templateUrl);
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -47,20 +47,20 @@ angular.module('forms').directive('fieldDirective', ['$http', '$compile', '$root
|
||||||
},
|
},
|
||||||
link: function(scope, element) {
|
link: function(scope, element) {
|
||||||
scope.setActiveField = $rootScope.setActiveField;
|
scope.setActiveField = $rootScope.setActiveField;
|
||||||
|
|
||||||
//Set format only if field is a date
|
//Set format only if field is a date
|
||||||
if(scope.field.fieldType === 'date'){
|
if(scope.field.fieldType === 'date'){
|
||||||
scope.dateOptions = {
|
scope.dateOptions = {
|
||||||
changeYear: true,
|
changeYear: true,
|
||||||
changeMonth: true,
|
changeMonth: true,
|
||||||
altFormat: 'mm/dd/yyyy',
|
altFormat: 'mm/dd/yyyy',
|
||||||
yearRange: '1900:-0',
|
yearRange: '1900:-0',
|
||||||
defaultDate: 0,
|
defaultDate: 0,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
var fieldType = scope.field.fieldType;
|
var fieldType = scope.field.fieldType;
|
||||||
|
|
||||||
if(scope.field.fieldType === 'number' || scope.field.fieldType === 'textfield' || scope.field.fieldType === 'email' || scope.field.fieldType === 'link'){
|
if(scope.field.fieldType === 'number' || scope.field.fieldType === 'textfield' || scope.field.fieldType === 'email' || scope.field.fieldType === 'link'){
|
||||||
switch(scope.field.fieldType){
|
switch(scope.field.fieldType){
|
||||||
case 'textfield':
|
case 'textfield':
|
||||||
|
|
Loading…
Reference in a new issue