@@ -235,8 +235,171 @@ angularTextMarkup('option', function(text, textNode, parentElement){
235
235
* @param {template } template any string which can contain `{{}}` markup.
236
236
*/
237
237
238
+ /**
239
+ * @workInProgress
240
+ * @ngdoc directive
241
+ * @name angular.directive.ng:disabled
242
+ *
243
+ * @description
244
+ *
245
+ * The following markup will make the button enabled on Chrome/Firefox but not on IE8 and older IEs:
246
+ * <pre>
247
+ * <div ng:init="scope = { isDisabled: false }">
248
+ * <button disabled="{{scope.isDisabled}}">Disabled</button>
249
+ * </div>
250
+ * </pre>
251
+ *
252
+ * the HTML specs do not require browsers preserve the special attributes such as disabled.(The presense of them means true and absense means false)
253
+ * This prevents the angular compiler from correctly retrieving the binding expression.
254
+ * To solve this problem, we introduce ng:disabled.
255
+ *
256
+ * @example
257
+ <doc:example>
258
+ <doc:source>
259
+ Click me to toggle: <input type="checkbox" name="checked"><br/>
260
+ <button name="button" ng:disabled="{{checked}}">Button</button>
261
+ </doc:source>
262
+ <doc:scenario>
263
+ it('should toggle button', function() {
264
+ expect(element('.doc-example-live :button').attr('disabled')).toBeFalsy();
265
+ input('checked').check();
266
+ expect(element('.doc-example-live :button').attr('disabled')).toBeTruthy();
267
+ });
268
+ </doc:scenario>
269
+ </doc:example>
270
+ *
271
+ * @element ANY
272
+ * @param {template } template any string which can contain '{{}}' markup.
273
+ */
274
+
275
+
276
+ /**
277
+ * @workInProgress
278
+ * @ngdoc directive
279
+ * @name angular.directive.ng:checked
280
+ *
281
+ * @description
282
+ * the HTML specs do not require browsers preserve the special attributes such as checked.(The presense of them means true and absense means false)
283
+ * This prevents the angular compiler from correctly retrieving the binding expression.
284
+ * To solve this problem, we introduce ng:checked.
285
+ * @example
286
+ <doc:example>
287
+ <doc:source>
288
+ Check me to check both: <input type="checkbox" name="master"><br/>
289
+ <input id="checkSlave" type="checkbox" ng:checked="{{master}}">
290
+ </doc:source>
291
+ <doc:scenario>
292
+ it('should check both checkBoxes', function() {
293
+ expect(element('.doc-example-live #checkSlave').attr('checked')).toBeFalsy();
294
+ input('master').check();
295
+ expect(element('.doc-example-live #checkSlave').attr('checked')).toBeTruthy();
296
+ });
297
+ </doc:scenario>
298
+ </doc:example>
299
+ *
300
+ * @element ANY
301
+ * @param {template } template any string which can contain '{{}}' markup.
302
+ */
303
+
304
+
305
+ /**
306
+ * @workInProgress
307
+ * @ngdoc directive
308
+ * @name angular.directive.ng:multiple
309
+ *
310
+ * @description
311
+ * the HTML specs do not require browsers preserve the special attributes such as multiple.(The presense of them means true and absense means false)
312
+ * This prevents the angular compiler from correctly retrieving the binding expression.
313
+ * To solve this problem, we introduce ng:multiple.
314
+ *
315
+ * @example
316
+ <doc:example>
317
+ <doc:source>
318
+ Check me check multiple: <input type="checkbox" name="checked"><br/>
319
+ <select id="select" ng:multiple="{{checked}}">
320
+ <option>Misko</option>
321
+ <option>Igor</option>
322
+ <option>Vojita</option>
323
+ <option>Di</option>
324
+ </select>
325
+ </doc:source>
326
+ <doc:scenario>
327
+ it('should toggle multiple', function() {
328
+ expect(element('.doc-example-live #select').attr('multiple')).toBeFalsy();
329
+ input('checked').check();
330
+ expect(element('.doc-example-live #select').attr('multiple')).toBeTruthy();
331
+ });
332
+ </doc:scenario>
333
+ </doc:example>
334
+ *
335
+ * @element ANY
336
+ * @param {template } template any string which can contain '{{}}' markup.
337
+ */
338
+
339
+
340
+ /**
341
+ * @workInProgress
342
+ * @ngdoc directive
343
+ * @name angular.directive.ng:readonly
344
+ *
345
+ * @description
346
+ * the HTML specs do not require browsers preserve the special attributes such as readonly.(The presense of them means true and absense means false)
347
+ * This prevents the angular compiler from correctly retrieving the binding expression.
348
+ * To solve this problem, we introduce ng:readonly.
349
+ * @example
350
+ <doc:example>
351
+ <doc:source>
352
+ Check me to make text readonly: <input type="checkbox" name="checked"><br/>
353
+ <input type="text" ng:readonly="{{checked}}" value="I'm Angular"/>
354
+ </doc:source>
355
+ <doc:scenario>
356
+ it('should toggle readonly attr', function() {
357
+ expect(element('.doc-example-live :text').attr('readonly')).toBeFalsy();
358
+ input('checked').check();
359
+ expect(element('.doc-example-live :text').attr('readonly')).toBeTruthy();
360
+ });
361
+ </doc:scenario>
362
+ </doc:example>
363
+ *
364
+ * @element ANY
365
+ * @param {template } template any string which can contain '{{}}' markup.
366
+ */
367
+
368
+
369
+ /**
370
+ * @workInProgress
371
+ * @ngdoc directive
372
+ * @name angular.directive.ng:selected
373
+ *
374
+ * @description
375
+ * the HTML specs do not require browsers preserve the special attributes such as selected.(The presense of them means true and absense means false)
376
+ * This prevents the angular compiler from correctly retrieving the binding expression.
377
+ * To solve this problem, we introduce ng:selected.
378
+ * @example
379
+ <doc:example>
380
+ <doc:source>
381
+ Check me to select: <input type="checkbox" name="checked"><br/>
382
+ <select>
383
+ <option>Hello!</option>
384
+ <option id="greet" ng:selected="{{checked}}">Greetings!</option>
385
+ </select>
386
+ </doc:source>
387
+ <doc:scenario>
388
+ it('should select Greetings!', function() {
389
+ expect(element('.doc-example-live #greet').attr('selected')).toBeFalsy();
390
+ input('checked').check();
391
+ expect(element('.doc-example-live #greet').attr('selected')).toBeTruthy();
392
+ });
393
+ </doc:scenario>
394
+ </doc:example>
395
+ * @element ANY
396
+ * @param {template } template any string which can contain '{{}}' markup.
397
+ */
398
+
399
+
238
400
var NG_BIND_ATTR = 'ng:bind-attr' ;
239
401
var SPECIAL_ATTRS = { } ;
402
+
240
403
forEach ( 'src,href,checked,disabled,multiple,readonly,selected' . split ( ',' ) , function ( name ) {
241
404
SPECIAL_ATTRS [ 'ng:' + name ] = name ;
242
405
} ) ;
0 commit comments