@@ -103,9 +103,9 @@ import {DEFAULT} from 'angular2/change_detection';
103103 *
104104 * @Directive ({
105105 * selector: '[dependency]',
106- * properties: {
107- * 'id':' dependency'
108- * }
106+ * properties: [
107+ * 'id: dependency'
108+ * ]
109109 * })
110110 * class Dependency {
111111 * id:string;
@@ -275,9 +275,9 @@ import {DEFAULT} from 'angular2/change_detection';
275275 * ```
276276 * @Directive ({
277277 * selector: '[tooltip]',
278- * properties: {
279- * 'text': ' tooltip'
280- * } ,
278+ * properties: [
279+ * 'text: tooltip'
280+ * ] ,
281281 * hostListeners: {
282282 * 'onmouseenter': 'onMouseEnter()',
283283 * 'onmouseleave': 'onMouseLeave()'
@@ -361,9 +361,7 @@ import {DEFAULT} from 'angular2/change_detection';
361361 * ```
362362 * @Directive ({
363363 * selector: '[unless]',
364- * properties: {
365- * 'unless': 'unless'
366- * }
364+ * properties: ['unless']
367365 * })
368366 * export class Unless {
369367 * viewContainer: ViewContainerRef;
@@ -453,52 +451,53 @@ export class Directive extends Injectable {
453451 * Enumerates the set of properties that accept data binding for a directive.
454452 *
455453 * The `properties` property defines a set of `directiveProperty` to `bindingProperty`
456- * key-value pairs :
454+ * configuration :
457455 *
458456 * - `directiveProperty` specifies the component property where the value is written.
459457 * - `bindingProperty` specifies the DOM property where the value is read from.
460458 *
461459 * You can include a {@link Pipe} when specifying a `bindingProperty` to allow for data
462- * transformation and structural
463- * change detection of the value. These pipes will be evaluated in the context of this component.
464- *
460+ * transformation and structural change detection of the value. These pipes will be evaluated in
461+ * the context of this component.
465462 *
466463 * ## Syntax
467464 *
465+ * There is no need to specify both `directiveProperty` and `bindingProperty` when they both have
466+ * the same value.
467+ *
468468 * ```
469469 * @Directive ({
470- * properties: {
471- * 'directiveProperty1': 'bindingProperty1',
472- * 'directiveProperty2': 'bindingProperty2 | pipe1 | ...',
470+ * properties: [
471+ * 'propertyName', // shorthand notation for 'propertyName: propertyName'
472+ * 'directiveProperty1: bindingProperty1',
473+ * 'directiveProperty2: bindingProperty2 | pipe1 | ...',
473474 * ...
474- * }
475+ * ]
475476 * }
476477 * ```
477478 *
478479 *
479480 * ## Basic Property Binding
480481 *
481482 * We can easily build a simple `Tooltip` directive that exposes a `tooltip` property, which can
482- * be used in templates
483- * with standard Angular syntax. For example:
483+ * be used in templates with standard Angular syntax. For example:
484484 *
485485 * ```
486486 * @Directive ({
487487 * selector: '[tooltip]',
488- * properties: {
489- * 'text': ' tooltip'
490- * }
488+ * properties: [
489+ * 'text: tooltip'
490+ * ]
491491 * })
492492 * class Tooltip {
493- * set text(text ) {
494- * // This will get called every time the 'tooltip' binding changes with the new value.
493+ * set text(value: string ) {
494+ * // This will get called every time with the new value when the 'tooltip' property changes
495495 * }
496496 * }
497497 * ```
498498 *
499499 * We can then bind to the `tooltip' property as either an expression (`someExpression`) or as a
500- * string literal, as
501- * shown in the HTML template below:
500+ * string literal, as shown in the HTML template below:
502501 *
503502 * ```html
504503 * <div [tooltip]="someExpression">...</div>
@@ -508,27 +507,24 @@ export class Directive extends Injectable {
508507 * Whenever the `someExpression` expression changes, the `properties` declaration instructs
509508 * Angular to update the `Tooltip`'s `text` property.
510509 *
511- *
512- *
513510 * ## Bindings With Pipes
514511 *
515512 * You can also use pipes when writing binding definitions for a directive.
516513 *
517514 * For example, we could write a binding that updates the directive on structural changes, rather
518- * than on reference
519- * changes, as normally occurs in change detection.
515+ * than on reference changes, as normally occurs in change detection.
520516 *
521517 * See {@link Pipe} and {@link keyValDiff} documentation for more details.
522518 *
523519 * ```
524520 * @Directive ({
525521 * selector: '[class-set]',
526- * properties: {
527- * 'classChanges': ' classSet | keyValDiff'
528- * }
522+ * properties: [
523+ * 'classChanges: classSet | keyValDiff'
524+ * ]
529525 * })
530526 * class ClassSet {
531- * set classChanges(changes:KeyValueChanges) {
527+ * set classChanges(changes: KeyValueChanges) {
532528 * // This will get called every time the `class-set` expressions changes its structure.
533529 * }
534530 * }
@@ -544,7 +540,7 @@ export class Directive extends Injectable {
544540 * keyValDiff`.
545541 *
546542 */
547- properties : StringMap < string , string > ;
543+ properties : List < string > ;
548544
549545 /**
550546 * Enumerates the set of emitted events.
@@ -756,7 +752,7 @@ export class Directive extends Injectable {
756752 hostActions, lifecycle, hostInjector, compileChildren = true ,
757753 } : {
758754 selector ?: string ,
759- properties ?: any ,
755+ properties ?: List < string > ,
760756 events ?: List < string > ,
761757 hostListeners ?: StringMap < string , string > ,
762758 hostProperties ?: StringMap < string , string > ,
@@ -981,7 +977,7 @@ export class Component extends Directive {
981977 hostActions, appInjector, lifecycle, hostInjector, viewInjector,
982978 changeDetection = DEFAULT , compileChildren = true } : {
983979 selector ?: string ,
984- properties ?: Object ,
980+ properties ?: List < string > ,
985981 events ?: List < string > ,
986982 hostListeners ?: Map < string , string > ,
987983 hostProperties ?: any ,
@@ -1053,10 +1049,10 @@ export const onDestroy = CONST_EXPR(new LifecycleEvent("onDestroy"));
10531049 * ```
10541050 * @Directive ({
10551051 * selector: '[class-set]',
1056- * properties: {
1057- * 'propA': 'propA'
1058- * 'propB': 'propB'
1059- * } ,
1052+ * properties: [
1053+ * 'propA',
1054+ * 'propB'
1055+ * ] ,
10601056 * lifecycle: [onChange]
10611057 * })
10621058 * class ClassSet {
0 commit comments