question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@Input, @Output Properties

See original GitHub issue

I tried to add @Input, @Output Properties to a component:

@Component({selector: 'todo-cmp'})
class TodoCmp {
  @Input() model;
  @Output() complete = new EventEmitter(); // TypeScript supports initializing fields

  onCompletedButton() {
    this.complete.next(); // this fires an event
  }
}

But i get the error: [DiffingTSCompiler]: Typescript found the following errors: app/app1.ts (13, 4): Cannot find name 'Input'.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

11reactions
cironunescommented, Dec 8, 2015

If you’re using Angular Alpha 46, you should import the following for the code that you sent:

import {Input, Output, Component} from 'angular2/angular2';

If you update to the latest Alpha 48:

import {Component, Input, Output} from 'angular2/core';
0reactions
angular-automatic-lock-bot[bot]commented, Sep 5, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sharing data between child and parent directives ... - Angular
@Output() marks a property in a child component as a doorway through which data can travel from the child to the parent. The...
Read more >
Input() and @Output() properties - Angular Hispano
@Input() and @Output() allow Angular to share data between the parent context and child directives or components. An @Input() property is writable while...
Read more >
Input and output properties - IBM
You can specify the properties that a sub-model expects as input from its parent model or external system. These properties are referred to...
Read more >
Angular @input, @output & EventEmitter - TekTutorialsHub
The @output defines the output property (event), which we raise in the child component using the EventEmitter . The parent listens to these...
Read more >
Input and Output in Angular - Medium
“Input” and “Output” are defined in “Child component”. Sometimes we need to put information or object for initialization in “Child component” for that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found