سؤال

AngularJS uses square brackets for parameters to its directives (input[number])

but Jade also uses square brackets for class attributes.

So this doesn't work

input(type='number' [name='amount'] [min='min'] [max='max'])

Cannot read property 'amount' of undefined

Is there a way to escape square brackets in Jade?

هل كانت مفيدة؟

المحلول

The square brackets from angular's documentation indicate that the attribute is optional, but the square brackets should not be used in html itself.

This example:

 <input type="number" name="input" ng-model="value"
                 min="0" max="99" required>

is from angular's documentation and it does not use any square brackets.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top