2016-04-30 14 views
0

示しdoesntのonclickイベントハンドラですが、何らかの理由でファイルを選択するためのポップアップダイアログが表示されません。私はまた、任意のCSSを削除しようとすると、その正確なアイテムがクリックされていることを確認し、それは別のdivやそのようなもので覆われていないことを確認します。何か案が?入力タイプ=「ファイルは、」onclickの動作しますが、ファイル選択は、私は、次のコードをしている

答えて

0

aの中にinputがネストされていたことが原因でした。有効なHTMLではありません。しかし、<a>のクリックには、src属性がない場合は何もしないように、Angularを使用していないと、おそらくうまくいきました。

var htmlAnchorDirective = valueFn({ 
restrict: 'E', 
compile: function(element, attr) { 
    if (!attr.href && !attr.xlinkHref) { 
    return function(scope, element) { 
     // If the linked element is not an anchor tag anymore, do nothing 
     if (element[0].nodeName.toLowerCase() !== 'a') return; 

     // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute. 
     var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ? 
       'xlink:href' : 'href'; 
     element.on('click', function(event) { 
     // if we have no href url, then don't navigate anywhere. 
     if (!element.attr(href)) { 
      event.preventDefault(); 
     } 
     }); 
    }; 
    } 
} 
}); 

コンテナをdivに変更すると問題が解決しました。

0

アラートボックスの[OK]ボタンをクリックすると、コードダイアログボックスが表示されます。 Click Here

Please see my code in the above Link. 
関連する問題