我在我的项目中使用了bootstrap的模式弹出窗口,并希望得到以下内容:
角度材料的datepicker.我想保持日期选择器的更改格式为dd-mm-yyyy.
angular.module('MyApp')
.controller('AppCtrl', function($scope) {
$scope.myDate = new Date();
$scope.minDate = new Date(
$scope.myDate.getFullYear(),
$scope.myDate.getMonth() - 2,
$scope.myDate.getDate());
$scope.maxDate = new Date(
$scope.myDate.getFullYear(),
$scope.myDate.getMonth() + 2,
$scope.myDate.getDate()); }).config(function($mdDateLocaleProvider) {
$mdDateLocaleProvider.formatDate = function(date) {
return moment(date).format('YYYY-MM-DD');
};
});
Run Code Online (Sandbox Code Playgroud)
但我希望在应用程序中为所有日期选择器进行一次配置.我认为这个例子是针对单日期选择器的.
我试图将json字符串转换为xml 1)我的json是
[
{
"QuizTitle":"asdf",
"QuizImage":"",
"QuizCategory":"0",
"QuizTags":"asdf",
"question":[
[
{
"QuestionType":"1",
"QuestionTitle":"asdf",
"questionOption":[
{
"QuestionOptionValue":"sdf",
"QuestionOptionIsRight":"0"
},
{
"QuestionOptionValue":"asdf",
"QuestionOptionIsRight":"1"
}
]
}
],
[
{
"QuestionType":"2",
"QuestionTitle":"sdfdsf",
"questionOption":[
{
"QuestionOptionValue":"asdf",
"QuestionOptionIsRight":"0"
},
{
"QuestionOptionValue":"asdf",
"QuestionOptionIsRight":"1"
}
]
}
]
]
}
]
Run Code Online (Sandbox Code Playgroud)
2)我的c#代码是
XmlDocument doc = JsonConvert.DeserializeXmlNode(str);
Run Code Online (Sandbox Code Playgroud)
获得以下错误:
错误: - XmlNodeConverter只能转换以对象开头的JSON.
我想小编辑在json类似remove []的问题元素.但没有奏效.