Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] @example on components doesn't work after update #1099

Closed
wauss417 opened this issue Jul 15, 2021 · 3 comments
Closed

[BUG] @example on components doesn't work after update #1099

wauss417 opened this issue Jul 15, 2021 · 3 comments

Comments

@wauss417
Copy link

Code example:

/**
 * Component to animate a increasing a number from 0 to its value
 * @example
 * <app-animated-count [digit]="5">
 * </app-animated-count>
 */
@Component({
    selector: 'app-animated-count',
    template: '<span #animatedDigit>{{digit}}</span>',
    styleUrls: ['./animated-count.component.css']
})
Operating System, Node.js, npm, compodoc version(s)

windows 10 v:19042.1110
Nodejs: v14.15.5
npm: v 6.14.11
Package:

  "dependencies": {
    "@angular/animations": "^11.1.2",
    "@angular/common": "~11.1.2",
    "@angular/compiler": "~11.1.2",
    "@angular/core": "~11.1.2",
    "@angular/forms": "~11.1.2",
    "@angular/platform-browser": "~11.1.2",
    "@angular/platform-browser-dynamic": "~11.1.2",
    "@angular/router": "~11.1.2",
    "angular": "^1.8.2",
    "angular-sanitize": "^1.8.2",
    "lodash-es": "^4.17.20",
    "rxjs": "~6.5.5",
    "sweetalert2": "^10.9.0",
    "tslib": "^2.0.0",
    "zone.js": "~0.10.3"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.1101.4",
    "@angular/cli": "~11.1.4",
    "@angular/compiler-cli": "~11.1.2",
    "@compodoc/compodoc": "^1.1.14",
    "@types/jasmine": "~3.6.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/lodash-es": "^4.17.4",
    "@types/node": "^12.11.1",
    "codelyzer": "^6.0.0",
    "csso-cli": "^3.0.0",
    "gzipper": "^4.5.0",
    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~5.2.3",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "protractor": "~7.0.0",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~4.1.3"
  }

Compodoc (local): v1.1.10

image

Compodoc (local) v1.1.14
image

@vogloblinsky
Copy link
Contributor

Is this working ?

/**
 * Component to animate a increasing a number from 0 to its value
 * @example
 * ```
 * <app-animated-count [digit]="5">
 * </app-animated-count>
 * ```
 */

@wauss417
Copy link
Author

Is this working ?

/**
 * Component to animate a increasing a number from 0 to its value
 * @example
 * ```
 * <app-animated-count [digit]="5">
 * </app-animated-count>
 * ```
 */

yeah, with that change it works.

This is kinda weird because '@example' still working on methods but no on decorated classes.
Besides I found other weird case.

Code example:

/**
 * directive to focus to a element once it is rendered by DOM, component o ng directive.
 * @example
 * <div>
 *     <label for="input_name" class="field-label">
 *          input_name
 *    </label>
 *     <input type="text" name="input_name" appFocusTo>
 * </div>
 */
@Directive({
  selector: '[appFocusTo]'
})

image

I test it on a method comment.

  /**
   * Change focus to the element once it has been rendered
   * @example
   * <div>
   *     <label for="input_name" class="field-label">
   *          input_name
   *    </label>
   *     <input type="text" name="input_name" appFocusTo>
   * </div>
   */
  ngAfterViewInit() {
  }

image

I think it tries to render whatever comes after '@example'.

When I add ``` it is fixed

@vogloblinsky vogloblinsky added this to the 1.1.15 milestone Jul 16, 2021
@torsten-bit
Copy link

torsten-bit commented Aug 19, 2021

This issue seems to have been introduced with 1.1.12. With version 1.1.11, the @example on component-doc-comments is rendered correctly, when containing html-tags. But the issue occurs when updating to 1.1.12.

However in 1.1.11, opening-tags in method-@example-comments are rendered with escaped brackets, when using custom-elements with input-bindings.

/**
 * @example
 * <grid [gridData]="gridData">
 * </grid>
 */

2021-08-19_14h34_25

@vogloblinsky vogloblinsky modified the milestones: 1.1.15, 1.1.16 Sep 15, 2021
@vogloblinsky vogloblinsky modified the milestones: 1.1.16, 1.1.17 Oct 12, 2021
@vogloblinsky vogloblinsky modified the milestones: 1.1.17, 1.1.18 Dec 6, 2021
@vogloblinsky vogloblinsky modified the milestones: 1.1.18, 1.1.19 Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants