Jop V. Jop V. - 1 year ago 117
Dart Question

"NoSuchCapabilityError: no capability to invoke the method" when assigning an action to a button


<dom-module id="main-app">
<paper-button on-tap="nextStep" raised>Next step</paper-button>
<p>The step is {{step}}</p>




class MainApp extends PolymerElement {

@property int step = 0;

MainApp.created() : super.created();


void nextStep() {
step = step + 1;
print('Next step!');

When I run this and press the button, I get this error in Dartium's console:

NoSuchCapabilityError: no capability to invoke the method 'nextStep'

What am I doing wrong?

Answer Source

Please try

void nextStep(event, [_]) {


void nextStep([_, __]) {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download