4

ユーザーがコントローラーの範囲外をクリックするたびにリセットする必要がある角度コントローラーがあります。どうすればいいですか?

サンプル HTML:

<div id='parent'>
    <div id='1' ng-controller="ctrl1">
        <!--other things-->
    </div>

    <div id='2' ng-controller="ctrl2">
        <!--other things-->
    </div>
</div>
<div id="parent2">
        <!--other things-->
</div>

ctr2クリックがdiv2の外で発生したとき以外にクリックが発生した場合、ctrl2をリセットできるようにしたい

ctr2 には内部で定義されたリセット関数があります

4

2 に答える 2