Skip to content

Commit 6a4ebbe

Browse files
committed
docs: fix doc comment syntax
1 parent bd7060f commit 6a4ebbe

File tree

2 files changed

+59
-50
lines changed

2 files changed

+59
-50
lines changed

Diff for: packages/animations/src/animation_metadata.ts

+58-49
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ export declare type AnimateTimings = {
2727
easing: string | null
2828
};
2929

30+
exampleFolders.forEach(folder => exampleMap[folder] = exampleMap[folder] || []);
31+
3032
/**
3133
* @description Options that control animation styling and timing.
3234
*
@@ -324,23 +326,25 @@ export interface AnimationStaggerMetadata extends AnimationMetadata {
324326
*
325327
* @return An {@link AnimationTriggerMetadata AnimationTriggerMetadata} object that encapsulates the trigger data.
326328
*
327-
* @notes Define an animation trigger in the
328-
* {@link Component#animations `@Component.animations` section}.
329+
* @usageNotes Define an animation trigger in the
330+
* {@link Component#animations @Component.animations section}.
329331
* In the template, reference the trigger by name and bind it to a trigger expression that
330332
* evaluates to a defined animation state, using the following format:
333+
*
331334
* `[@triggerName]="expression"`
332335
*
333336
* Animation trigger bindings convert all values to strings, and then match the previous and current values against
334337
* any linked transitions. Booleans can be specified as `1` or `true` and `0` or `false`.
335338
*
336-
* ### Usage Example
339+
* ### Usage Example
340+
*
337341
* The following example creates an animation trigger reference based on the provided name value.
338342
* The provided animation value is expected to be an array consisting of state and transition declarations.
339343
*
340-
* ```typescript
344+
* ```ts
341345
* @Component({
342-
* selector: 'my-component',
343-
* templateUrl: 'my-component-tpl.html',
346+
* selector: "my-component",
347+
* templateUrl: "my-component-tpl.html",
344348
* animations: [
345349
* trigger("myAnimationTrigger", [
346350
* state(...),
@@ -522,6 +526,7 @@ return {type: AnimationMetadataType.Group, steps, options};
522526
* - Steps defined by {@link style style()} calls apply the styling data immediately.
523527
* - Steps defined by {@link animate animate()} calls apply the styling data over time
524528
* as specified by the timing data.
529+
*
525530
* ``` typescript
526531
* sequence([
527532
* style({ opacity: 0 })),
@@ -567,16 +572,14 @@ return {type: AnimationMetadataType.Sequence, steps, options};
567572
*
568573
* @return An {@link AnimationStyleMetadata AnimationStyleMetadata} object that encapsulates the style data.
569574
*
570-
* * @usageNotes
571-
* ### Usage
572-
* The following examples create animation styles that collect a set of CSS property values:
575+
* @usageNotes The following examples create animation styles that collect a set of CSS property values:
573576
*
574-
* ```
577+
* ```ts
575578
* // string values for CSS properties
576579
* style({ background: "red", color: "blue" })
577580
*
578581
* // numerical pixel values
579-
* style({ width: 100, height: 0 })</pre>
582+
* style({ width: 100, height: 0 })
580583
* ```
581584
*
582585
* The following example uses auto-styling to allow a component to animate from
@@ -642,11 +645,13 @@ return {type: AnimationMetadataType.State, name, styles, options};
642645
*
643646
* ### Usage
644647
*
645-
* For each `style()` entry an `offset` value can be set. Doing so allows to specifiy at what
646-
* percentage of the animate time the styles will be applied.
648+
* The optional `offset` value for a style specifies a percentage of the total animation
649+
* time in which that style is applied. In the following example, the offset values describe
650+
* when each `backgroundColor` value is applied. The color is red at the start, and changes to
651+
* blue when 20% of the total time has elapsed.
647652
*
648-
* ```typescript
649-
* // the provided offset values describe when each backgroundColor value is applied.
653+
* ```ts
654+
* // the provided offset values
650655
* animate("5s", keyframes([
651656
* style({ backgroundColor: "red", offset: 0 }),
652657
* style({ backgroundColor: "blue", offset: 0.2 }),
@@ -656,7 +661,7 @@ return {type: AnimationMetadataType.State, name, styles, options};
656661
* ```
657662
*
658663
* Alternatively, if there are no `offset` values used within the style entries then the offsets
659-
* will be calculated automatically.
664+
* are be calculated automatically.
660665
*
661666
* ```typescript
662667
* animate("5s", keyframes([
@@ -678,7 +683,9 @@ return {type: AnimationMetadataType.Keyframes, steps};
678683

679684
/**
680685
* @description Declares an animation transition as a sequence of animation steps to run when a given
681-
* condition is satisfied.
686+
* condition is satisfied. The condition is a Boolean expression or function that compares the previous and current animation states,
687+
* and returns true if this transition should occur. When a transition is defined that matches the state criteria,
688+
* the associated animation is triggered.
682689
*
683690
* @param stateChangeExpr A Boolean expression or function that compares the previous and current
684691
* animation states, and returns true if this transition should occur. Note that "true" and "false"
@@ -705,39 +712,42 @@ return {type: AnimationMetadataType.Keyframes, steps};
705712
* @returns An {@link AnimationTransitionMetadata AnimationTransitionMetadata} object that encapsulates the
706713
* transition data.
707714
*
708-
* @usageNotes The condition is a Boolean expression or function that compares the previous and current animation states,
709-
* and returns true if this transition should occur. When a transition is defined that matches the state criteria,
710-
* the associated animation is triggered.
715+
* @usageNotes
711716
*
712-
* Note that when you call the {@link sequence sequence()} function within a {@link group group()}
713-
* or a {@link transition transition()} call, execution does not continue to the next instruction
714-
* until each of the inner animation steps have completed.
715-
*
716-
* ### Syntax examples
717-
* The template associated with a component binds an animation trigger to an element.
717+
* The template associated with a component binds an animation trigger to an element.
718718
*
719719
* ```
720720
* <!-- somewhere inside of my-component-tpl.html -->
721721
* <div [@myAnimationTrigger]="myStatusExp">...</div>
722722
* ```
723-
* All transitions are defined within an animation trigger, along with named states that the transitions
724-
* change to and from.
725723
*
726-
* ```
724+
* All transitions are defined within an animation trigger,
725+
* along with named states that the transitions change to and from.
726+
*
727+
* ```ts
727728
* trigger("myAnimationTrigger", [
728-
* // define states
729-
* state("on", style({ background: "green" })),
730-
* state("off", style({ background: "grey" })),
731-
* ...
729+
* // define states
730+
* state("on", style({ background: "green" })),
731+
* state("off", style({ background: "grey" })),
732+
* ...]
733+
* ```
734+
*
735+
* Note that when you call the {@link sequence sequence()} function within a {@link group group()}
736+
* or a {@link transition transition()} call, execution does not continue to the next instruction
737+
* until each of the inner animation steps have completed.
738+
*
739+
* ### Syntax examples
740+
*
732741
* The following examples define transitions between the two defined states (and default states),
733742
* using various options:
743+
*
734744
* ```
735745
* // Transition occurs when the state value
736746
* // bound to "myAnimationTrigger" changes from "on" to "off"
737747
* transition("on => off", animate(500)),
738-
* // Run the same animation for both directions
748+
* // Run the same animation for both directions
739749
* transition("on <=> off", animate(500)),
740-
* // Define multiple state-change pairs separated by commas
750+
* // Define multiple state-change pairs separated by commas
741751
* transition("on => off, off => void", animate(500))
742752
* ]
743753
* ```
@@ -755,11 +765,12 @@ return {type: AnimationMetadataType.Keyframes, steps};
755765
* ```
756766
* - Capture a state change between any states:
757767
*
758-
* ```transition("* => *", animate("1s 0s"))```
768+
* `transition("* => *", animate("1s 0s"))`
759769
*
760770
* - Entry and exit transitions:
761771
*
762-
* ```transition(":enter", [
772+
* ```typescript
773+
* transition(":enter", [
763774
* style({ opacity: 0 }),
764775
* animate(500, style({ opacity: 1 }))
765776
* ]),
@@ -768,14 +779,14 @@ return {type: AnimationMetadataType.Keyframes, steps};
768779
* ])
769780
* ```
770781
*
771-
* Using `:increment` and `:decrement` to initiate transitions:
782+
* - Use `:increment` and `:decrement` to initiate transitions: (example TBD)
772783
*
773-
* {@example core/animation/ts/dsl/animation_example.ts region='Component'}
774784
*
775-
* ### State change functions
776-
* A function that invokes an animation when true:
785+
* ### State-change functions
786+
*
787+
* Here is an example of a `fromState` specified as a state-change function that invokes an animation when true:
777788
*
778-
* ```
789+
* ```js
779790
* transition((fromState, toState) =>
780791
* {
781792
* return fromState == "off" && toState == "on";
@@ -804,7 +815,7 @@ return {type: AnimationMetadataType.Transition, expr: stateChangeExpr, animation
804815
*
805816
* @example
806817
*
807-
* ```
818+
* ```js
808819
* var fadeAnimation = animation([
809820
* style({ opacity: '{{ start }}' }),
810821
* animate('{{ time }}',
@@ -817,7 +828,7 @@ return {type: AnimationMetadataType.Transition, expr: stateChangeExpr, animation
817828
* directly. If any of the passed in parameter values are missing then the default values will be
818829
* used. If one or more parameter values are missing before animated, an error is thrown.
819830
*
820-
* ```
831+
* ```js
821832
* useAnimation(fadeAnimation, {
822833
* params: {
823834
* time: '2s',
@@ -876,17 +887,15 @@ return {type: AnimationMetadataType.AnimateRef, animation, options};
876887
*
877888
* @param selector The element to query, or a set of elements that contain Angular-specific
878889
* characteristics, specified with one or more of the following tokens.
879-
* - `query(":enter")`/`query(":leave")` : Query for newly inserted/removed elements.
890+
* - `query(":enter")` or `query(":leave")` : Query for newly inserted/removed elements.
880891
* - `query(":animating")` : Query all currently animating elements.
881892
* - `query("@triggerName")` : Query elements that contain an animation trigger.
882893
* - `query("@*")` : Query all elements that contain an animation triggers.
883894
* - `query(":self")` : Include the current element into the animation sequence.
884895
*
885896
* Tokens can be merged into a combined query selector string. For example:
886897
*
887-
* ```
888-
* query(':self, .record:enter, .record:leave, @subTrigger', [...])
889-
* ```
898+
* `query(':self, .record:enter, .record:leave, @subTrigger', [...])`
890899
*
891900
* @param animation One or more animation steps to apply to the queried element or elements.
892901
* An array is treated as an animation sequence.
@@ -999,7 +1008,7 @@ return {type: AnimationMetadataType.Query, selector, animation, options};
9991008
* templateUrl: 'list.component.html',
10001009
* animations: [
10011010
* trigger('listAnimation', [
1002-
* //...
1011+
* ...
10031012
* ])
10041013
* ]
10051014
* })

Diff for: packages/platform-browser/src/dom/events/hammer_gestures.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export class HammerGestureConfig {
122122
*/
123123

124124
buildHammer(element: HTMLElement): HammerInstance {
125-
const mc = new Hammer(element, this.options);
125+
const mc = new Hammer!(element, this.options);
126126

127127
mc.get('pinch').set({enable: true});
128128
mc.get('rotate').set({enable: true});

0 commit comments

Comments
 (0)