add public prefix to html2js conf

This commit is contained in:
Sam 2016-04-27 17:46:53 +03:00
parent 1ddf23a848
commit 42e9b7564e
2 changed files with 7 additions and 7 deletions

View file

@ -227,7 +227,7 @@ module.exports = function(grunt) {
},
html2js: {
options: {
base: 'NodeForm',
base: 'public',
watch: true,
module: 'NodeForm.templates',
singleModule: true,

View file

@ -10,7 +10,7 @@ var __indexOf = [].indexOf || function(item) {
angular.module('forms').directive('fieldDirective', ['$http', '$compile', '$rootScope', '$templateCache',
function($http, $compile, $rootScope, $templateCache) {
var getTemplateUrl = function(fieldType) {
var type = fieldType;
var templateUrl = 'modules/forms/views/directiveViews/field/';
@ -33,7 +33,7 @@ angular.module('forms').directive('fieldDirective', ['$http', '$compile', '$root
templateUrl = templateUrl+type+'.html';
}
return $templateCache.get('../public/'+templateUrl);
return $templateCache.get(templateUrl);
};
return {
@ -47,20 +47,20 @@ angular.module('forms').directive('fieldDirective', ['$http', '$compile', '$root
},
link: function(scope, element) {
scope.setActiveField = $rootScope.setActiveField;
//Set format only if field is a date
if(scope.field.fieldType === 'date'){
scope.dateOptions = {
changeYear: true,
changeMonth: true,
altFormat: 'mm/dd/yyyy',
yearRange: '1900:-0',
yearRange: '1900:-0',
defaultDate: 0,
};
}
var fieldType = scope.field.fieldType;
if(scope.field.fieldType === 'number' || scope.field.fieldType === 'textfield' || scope.field.fieldType === 'email' || scope.field.fieldType === 'link'){
switch(scope.field.fieldType){
case 'textfield':