请协助正确的RegEx匹配.任何2个字母后跟6个整数的任意组合.
These would be valid:
RJ123456
PY654321
DD321234
These would not
DDD12345
12DDD123
Run Code Online (Sandbox Code Playgroud) 我是平均堆栈的新手.我想知道如何通过angularjs将图像文件上传到数据库(mongoose).如果可能的话,请提供一些代码.我在互联网上搜索但我没有找到任何合适的代码.
我正在使用x-editable进行内联编辑.当我通过ajax和x-editable更新值以获得响应时,我发现很难覆盖包含新的x-editable值的div.
例如,我的x-editable链接如下所示:
<a href="#" id="freight">$100</a>
Run Code Online (Sandbox Code Playgroud)
我在x-editable提供的弹出窗口中输入我的编辑,然后输入值300.00
当我进行编辑时,我按以下步骤操作:
$('#freight').editable({
validate: function(value) {
if($.trim(value) == '') return 'This value is required.';
},
type: 'text',
url: '{{ path('update_purchase_order_ajax') }}',
pk: {{ purchaseOrder.id }},
title: 'Enter Freight Value',
ajaxOptions: {
dataType: 'json'
},
success: function(response, newValue) {
// Update the purchase order amounts...
$('#freight').html('$' + newValue);
}
});
Run Code Online (Sandbox Code Playgroud)
当x-editable完成后,页面上显示的值现在为300.00(没有$ dollar符号).正如你在我的jquery代码中看到的那样,我试图覆盖x-editable的值,用$('#furrency')放置页面.html('$'+ newValue);
由于某种原因,这是行不通的.我希望300.00美元出现,而不是300.00.
我想将一些数据传递给$ mdDialog.事实上,我有牵引控制器在单独的文件中.这是我的控制器代码
function openDialog(id) {
$mdDialog.show({
locals:{
profileId: id
},
controller: ['$scope', 'profileId', function($scope, profileId) {
var self = this;
self.profileId= profileId;
}],
controllerAs: 'profileCtrl',
templateUrl: 'view/profile.html',
parent: angular.element(document.body),
clickOutsideToClose:true
})
}
Run Code Online (Sandbox Code Playgroud)
我希望tp将profileId传递给profileController并显示配置文件数据.在配置文件控制器中,我得到数据
function profileController($scope,..., profileId){
}
Run Code Online (Sandbox Code Playgroud)
但这个错误在控制台中出现了
Error: [$injector:unpr] Unknown provider: profileIdProvider <- profileId<- ProfileController
Run Code Online (Sandbox Code Playgroud)
这个错误是什么以及如何解决?
我需要将图像blob数据存储在表中.我知道在数据库表中以blob格式存储图像不是最佳做法.但这样做是客户的要求.我正在使用ColdFusion 10和SQL Server 2008.我已使用此代码段在SQL Server中插入图像blob数据.
<cfimage action="read" name="imdata" source="C:\inetpub\wwwroot\a.jpg" >
<cfquery datasource="localdsn">
INSERT INTO imtbl(image)
VALUES #imageGetBlob(imdata)#
</cfquery>
Run Code Online (Sandbox Code Playgroud)
但这是在抛出错误
ByteArray objects cannot be converted to strings.
我也试过使用#toString(imageGetBlob(imdata))#仍然没有成功.
我已经通过https://forums.adobe.com/thread/60629但是找不到任何解决方案.
我正在尝试搜索带有id的项目,但是我收到了此消息.所有功能都正常工作.执行时我收到此错误:
使用Firebase中的数组索引存储数据可能会导致意外行为.有关 详细信息,请参阅 https://www.firebase.com/docs/web/guide/understanding-data.html#section-arrays-in-firebase.
我的工厂
.factory('TEST', function ($firebaseArray) {
var ref = new Firebase('https://shark-firebase.firebaseio.com');
return {
all: function(section) {
var data = $firebaseArray(ref.child(section));
return data;
},
get: function(section, id) {
var data = $firebaseArray(ref.child(section).child(id));
return data;
}
};
});
Run Code Online (Sandbox Code Playgroud)
我一起试试:
get: function(section, id) {
var data = $firebaseArray(ref.child(section));
return data.$getRecord(id);
}
Run Code Online (Sandbox Code Playgroud)
和我的控制器:
如果是,$ stateParams.section ='posts'和$ stateParams.id ='0'.
$scope.loadItem = function(){
$scope.item = TEST.get($stateParams.section, $stateParams.id);
};
Run Code Online (Sandbox Code Playgroud) 我试图评估两个动态分配的变量; 然后尝试根据结果分配动态变量.我有更长的代码,这是有效的,但我正在努力巩固.
以下是我对合并代码的看法:
<cfloop list="dog,cat,pig,horse" index="i">
<cfif (#trim([i]_FMCTotal)# /2) GT #trim([i]_FMC)#>
<cfset #i#colorCode = 'red'>
<cfelseif (#trim([i]_FMCTotal)# /1.5) GT #trim([i]_FMC)#>
<cfset #i#colorCode = 'yellow'>
<cfelse>
<cfset #i#colorCode = 'green'>
</cfif>
</cfloop>
Run Code Online (Sandbox Code Playgroud) 我想连续输出两个数字:
- 第一
- 第二
以下是基本代码:
<cfloop index="x" from="2" to="#ListLen(stringOf200Numbers)#" >
<cfset x2 = x>
<cfoutput>
<h2>#x#</h2>
<h2>#x2#</h2>
</br>
</cfoutput>
</cfloop>
Run Code Online (Sandbox Code Playgroud)
我尝试了很多不同的角度..会喜欢一些专家的帮助......
coldfusion ×4
angularjs ×3
coldfusion-9 ×3
ajax ×1
angularfire ×1
cfloop ×1
express ×1
firebase ×1
javascript ×1
jquery ×1
mean-stack ×1
mongoose ×1
regex ×1
sql-server ×1