我有一个打字稿列举。我需要将枚举的值转换为字符串,以便可以将其传递给api端点。我该怎么做呢?谢谢。
enum RecordStatus {
CancelledClosed = 102830004,
Completed = 102830003,
InProgress = 102830002,
ShoppingCart = 102830005,
Submitted = 102830001,
Unordered = 102830000
}
Run Code Online (Sandbox Code Playgroud)
例:
var submittedStrValue = RecordStatus.Submitted // I want to get "10283001" (note the string value rather than the int value.
Run Code Online (Sandbox Code Playgroud) 我是javascript /编程的新手,在表单提交返回警报成功消息后,我无法尝试关闭引导模式.我想要发生的是用户:
我尝试过使用javascript hide功能,但没有运气.
$(document).ready(function(){
if($('#alert-success'))
{
$('#myModal').hide();
}
});
Run Code Online (Sandbox Code Playgroud)
任何帮助,将不胜感激!
这是我正在尝试创建的示例代码(注意:我已经包含了虚拟代码,因为我没有权限在此处使用我的公司代码).链接到下面的代码:http://jsbin.com/pidizetila/edit?html,output
<!-- Trigger the modal with a button -->
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button>
<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">× </button>
<h4 class="modal-title">Modal Header</h4>
</div>
<div class="modal-body">
<div class="alert alert-success">
<strong>Success!</strong> Indicates a successful or positive action.
</div>
</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)