Title: @Output attributes not emitting events if subclass has any @Input defined. · Issue #7191 · angular/angular · GitHub
Open Graph Title: @Output attributes not emitting events if subclass has any @Input defined. · Issue #7191 · angular/angular
X Title: @Output attributes not emitting events if subclass has any @Input defined. · Issue #7191 · angular/angular
Description: I have a following class export class AddAnimalComponent { public st: string; public dyn: string; public errMessage: string; @Output() added = new EventEmitter
Open Graph Description: I have a following class export class AddAnimalComponent { public st: string; public dyn: string; public errMessage: string; @Output() added = new EventEmitter
X Description: I have a following class export class AddAnimalComponent { public st: string; public dyn: string; public errMessage: string; @Output() added = new EventEmitter<Animal>(); constructor() { } ad...
Opengraph URL: https://github.com/angular/angular/issues/7191
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@Output attributes not emitting events if subclass has any @Input defined.","articleBody":"I have a following class\n\n```\nexport class AddAnimalComponent {\n public st: string;\n public dyn: string;\n public errMessage: string;\n @Output() added = new EventEmitter\u003cAnimal>();\n\n constructor() {\n }\n\n add() {\n throw new Error('Not implemented');\n }\n\n clearErr() {\n this.errMessage = '';\n }\n\n normalize() {\n this.st = this.st.trim();\n if (this.dyn) {\n this.dyn = this.dyn.trim();\n }\n }\n\n clear() {\n this.clearErr();\n this.st = '';\n if (this.dyn) {\n this.dyn = '';\n }\n }\n}\n```\n\nAnd then a subclass:\n\n```\n@Component({\n selector: 'add-expansion',\n templateUrl: './templates/add-expansion.html',\n directives: [MultiValueInput]\n})\n\nexport class AddExpansionComponent extends AddAnimalComponent implements AfterViewInit {\n //@Input('expansion') expansionType: string;\n\n constructor(private _animalService: AnimalService,\n @Inject('App.constants') private constants,\n private toastr: ToastsManager\n ) {\n super();\n }\n\n ngAfterViewInit() {\n //if (!this.expansionType) {\n // throw new Error('No expansion synonym type specified.');\n //}\n }\n\n add() {\n this.clearErr();\n this.normalize();\n\n if (this.st && this.st.length) {\n let abbr = new Animal(this.st);\n this._animalService.addAnimal(this.constants.activePartner, 'expansion-synonym', abbr)\n .subscribe((data) => {\n if (!data.success) {\n this.toastr.error(data.error, 'Oops');\n if (data.result) {\n this.errMessage = 'Existed: ' + JSON.stringify(data.result[0]);\n }\n } else {\n abbr = new Animal(data.result.st, data.result.dyn, data.result._id, data.result.status, data.result.action, data.result.newdyn);\n this.added.emit(abbr);\n this.clear();\n }\n },\n (err) => { this.errMessage = `Oops, server error: ${err}`; }\n );\n\n }\n }\n\n onDuplicate(item) {\n this.toastr.warning(`You have entered '${item}' more than once.`);\n }\n\n}\n```\n\nWhen I have @Input expansionType defined, the line \n`this.added.emit(abbr);` is not emitting any events. However, once I got all expansionType commented, the emit works.\n","author":{"url":"https://github.com/derekshi","@type":"Person","name":"derekshi"},"datePublished":"2016-02-19T20:18:24Z","url":"https://github.com/angular/angular/issues/7191"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d294ff7b-9bcc-66b5-25f2-23eaf960b49d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EE06:ADA9D:93DFA5:C17702:6B00DFE4 |
| html-safe-nonce | 706fba5cb03b57513d5b7e4557bce840a34ba7372ec73517488dda1fd22bd06e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRTA2OkFEQTlEOjkzREZBNTpDMTc3MDI6NkIwMERGRTQiLCJ2aXNpdG9yX2lkIjoiMzM4MDg1NzA1NDgzODcwMTgwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fddb4ee1115b4ad557711b3d0eb9c09bd9444230a0f422ed94ce631f7622fa61 |
| hovercard-subject-tag | issue:134963319 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/7191/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5e612d607772640f0c60c55cb8e6a3c429044f8d06772883b280273ad8f74ca6/angular/angular/issues/7191 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5e612d607772640f0c60c55cb8e6a3c429044f8d06772883b280273ad8f74ca6/angular/angular/issues/7191 |
| og:image:alt | I have a following class export class AddAnimalComponent { public st: string; public dyn: string; public errMessage: string; @Output() added = new EventEmitter |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | derekshi |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5425dc24e8bd8d6fca9641a12afc984825a43875 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width