描述:
我正在使用ui-router在图标点击时加载表单页面,只要用户单击新表单应该加载的图标(删除任何填充的字段)。我添加了ng-click图标,可以利用它来重置表单值。
的index.html
<td>
<a ui-sref="form2"
title="yahoo">
<span class="glyphicon glyphicon-file" ng-click="newForm('new')" id="yahooIcon" ></span>
</a>
</td>
form2.html
<input type="text" name="firstname" ng-model="myModel.firstname"><br>
app.js
$scope.newForm = function (id){
if ( id == 'new' )
{
console.log(" model value inside: "+$scope.myModel.firstname);
$scope.myModel = {};
}
}
问题:
DEMO (Plunker)
答案 0 :(得分:0)
请尝试这个
var err: NSError? = nil
let url=NSURL(fileURLWithPath: videoPath as String)
let asset = AVURLAsset(URL: url, options: nil)
let imgGenerator = AVAssetImageGenerator(asset: asset)
let cgImage = imgGenerator.copyCGImageAtTime(CMTimeMake(0, 1), actualTime: nil, error: &err)
let uiImage = UIImage(CGImage: cgImage)
let imageView = UIImageView(image: uiImage)