1

i want to make an onscreen Keyboard in dart with angular.js. If one letter is pressed it should be on the html site.

How does it work?

This is what i´ve got in the index.html:

<button on-click="einsController.generateName()"id="z" class="button">Z</button>
<button on-click="einsController.generateName()"id="u" class="button">U</button>
<button on-click="einsController.generateName()"id="i" class="button">I</button>
<button on-click="einsController.generateName()"id="o" class="button">O</button>
<button on-click="einsController.generateName()"id="p" class="button">P</button>
<button on-click="einsController.generateName()"id="a" class="button">A</button>
<button on-click="einsController.generateName()"id="s" class="button">S</button>
<button on-click="einsController.generateName()"id="d" class="button">D</button>
<button on-click="einsController.generateName()"id="f" class="button">F</button>
<button on-click="einsController.generateName()"id="g" class="button">G</button>
<button on-click="einsController.generateName()"id="h" class="button">H</button>
<button on-click="einsController.generateName()"id="j" class="button">J</button>
<button on-click="einsController.generateName()"id="k" class="button">K</button>
<button on-click="einsController.generateName()"id="l" class="button">L</button>
<button on-click="einsController.generateName()"id="y" class="button">Y</button>
<button on-click="einsController.generateName()"id="x" class="button">X</button>
<button on-click="einsController.generateName()"id="c" class="button">C</button>
<button on-click="einsController.generateName()"id="v" class="button">V</button>
<button on-click="einsController.generateName()"id="b" class="button">B</button>
<button on-click="einsController.generateName()"id="n" class="button">N</button>
<button on-click="einsController.increment()"id="m" class="button">M</button>

This is where the letter shall appear:

   <span id="badgeName">{{einsController.name}}  </span>

this is the function in the dart File:

  String name = '';

    void generateName() {
     name = "Q"; 
}

I still don´t get it. I think I need to change something in the method of generateName().

I want an onScreenKeyboard something like this http://code.tutsplus.com/tutorials/creating-a-keyboard-with-css-and-jquery--net-5774

Only that it I need to use dart Code.

4

1 回答 1

3

ng-click指令应该在您单击的按钮上,而不是在您要显示结果的标签上。

query('#letter_A').onClick.listen(...使用时不需要您的,ng-click它们具有类似的功能。

您需要放置控制器keyboard,以便您的按钮和<div>要显示输出的位置位于应用控制器的标签内。

试试看,如果它不起作用,用新代码更新你的问题,我再看看。

于 2014-04-23T05:32:07.440 回答