以下の簡単なテンプレートとdirective
withを書いています。angularJs
html template
contorller as c
<p>Input id : {{c.inputId()}}</p> <!--this is for test,correct value is shown-->
<input id="{{c.inputId()}}" type="text" />
しかし、問題は、<p>
テスト用のタグが正しい値を示していてもinput id
、値を取得できないことです。これらを
試しましたが、どれも機能しません。私のコードの何が問題なのか、どうすれば解決できますか?
EDIT 1私はそれがnullを返すことを説明する方が良いと思います..たぶん、質問を簡単にするために言及しなかったのは私の間違いであり、それがnullを返すことに気づきませんでした。id="c.inputId()"
id='c.inputId()'
id="{{c.inputId()}}"
id='{{c.inputId()}}'
documnet.getElementbyId
documnet.getElementbyId