感谢您提前提供帮助。
首先,我是 angularjs 的初学者,因此我遇到了我希望是一个微不足道的挑战。如果我应该改变我的方法,请告诉我。我正在运行它来解决我需要帮助的问题。
我正在尝试从 angularjs 循环内部调用一个函数。
要从循环内部调用的角度设置和函数
function switch_img24(v){
simg = {
//pdf icon 24 x 24
'pdf' : 'data:;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsSAAALEgHS3X78AAAGLklEQVRIiW2UT2xc1RXGf/fPezPjscdM/EeR7aRqSgBBACmJswE2WaA2wgjVC5BYskGR2m2kSogFVYT4I1gWlSJ2sEBKlAi16iJNRauorsCJTGMrkCgQeyadxDPP43kzb96de08X8SQh6pGu7uae++n7zvcdJSIA6oMPPhBrzM8PHjr0h3K5PNFutzf6/X7TOXdbRG5rpTYFOiIiCkYFqkqpCWPMRKFQ2DU2NjbTTdP2xUuXjrfb7WsnTpxQ1lqxgBaRUKlUDh85cuTUo48+Otfr9YIx5lCe52RZRhzHhBBI0xSAcrmMMYY8zzHGUCqVCCGEUqmkq9Xqub+dP7/ovf/aWqstoJ1zYWpq6ukDBw7Mffrpp25packUCoUwOzsre/bsYWVlhRCCeuKJJ8id49uVFYwxcuDAAfI8Z21tjTRN1fz8vHvttdd+trq2Nu+c+7pQKGgNiNaaTqfTyPOcVqtlarWa/vHHH/W+ffvM1taWOXjwoBkZGdGlUknn/b6en5/XzjkzPT1tLl68aBqNhqnVarrVamnnHJ1O579aawA0gFKKfr+/5b0nSRLq9Tr1ep3t7W2q1SrfffcdzWaT5eVl3n777btyFYtFSqUS6+vr1Ot1kiRR3nuyLEuUUgByl0G/399yzpEkia7X69RqNZxznDt3jvfee480TamMVXjhhQWazSYbGxtc/vZbzp46xe1Gg1qtRpIkeuAcWZYlQwZ2yCDP87Zzrl+r1Qrr6+sCqD998gmrq6u0t7b48ssvWVhYoNVq8fHHf2R0fJybacqV9Q2ikRIuSaRWr6vcuTzP860hAwsIgPd+u9VqdY8fP144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MtnzlB6+IiwXqdarbKzs8Na8Vccx8FxHLyeHl48Pc5ntz8/GsA0DEaGm/f8+ImTTWuhVct42XK4/+jP3cZhNbDbaO2T2cFzI4OsrK4yODBAPt9JLmdjWRZJkrATx0RxRK1a44HvI4RcaBtw7q1Jir895vY3d3no+2xFEUppfl4vIaXAy+c5MTzAm6dGuDT7/tttAwAKx57l3NQkAEprKsE2Win6vDxSSgAWFlKL/3+A/ZJC0O/lAVh/vM7iyiJ+2Qfgztydg7NcBi62BdivxZVFwt2QkyPPY0qTsy+dRSnFrbu3aKgGlaA8sRFszB0Z4Jd9ThXGMeXfKUb7RgGwTAsLC6vXYiPYmJBHBQB7ybNsR+4AYPKFScb6x5r+nX/9PAClconv7q8+HWAzqHAsP5hq+2Pzd+BAB1nHLU03vrix933tnWsAzH462+SzB5iZmRHtJE85lqkyofVlcwh0GZj4d3GvdA9DPnFrLme+KrI0PTf9KjC3H5JSwMW/AA54JUC3IXCtAAAAAElFTkSuQmCC',
}
return simg[v]
}
function allDocCtrl($scope){
//this will eventually be an ajax call but for now I have it as a hidden field
$scope.docsJson = $.parseJSON($("#doc_json").val());
//['file_name','regular_url','file_list','dir_name','dir_list']
rtn_html = ''
$scope.getExt = function(str){
var pattern = /\.[0-9a-z]+$/i;
var ext = (str).match(pattern);
var img = switch_img24(ext)
return img
}
}
HTML
<input type='hidden' id='doc_json' value='{'file_list':[
{
"file_name":"file.doc",
"url":"api/path..."
},
{
"file_name":"file.pdf",
"url":"api/path..."
},
{
"file_name":"file.txt",
"url":"api/path..."
},
]}'/>
<div id='due-diligence' ng-controller='allDocCtrl'>
<li ng-repeat="doc in docsJson.file_list">
{[{doc.file_name}]} who is {[{doc.url}]} years old.
<img src=getExt( doc.file_name ) width='15' height='15' />
</li>
</div>
所以我面临的挑战是从循环中调用 getExt( doc.file_name ) 任何和所有帮助都非常感谢!