I do not want to work the decorator @input in angular

0

Good morning to want to pass data from father to son with the decorator @ input to run the page I get this on the page:

Failed to compile.

./ src / app / son / hijo.component.ts Module not found: Error: Can not resolve '@ angular / core / src / metadata / directives' in 'C: \ wamp64 \ www \ test1 \ src \ app \ son'  @ ./src/app/hijo/hijo.component.ts 13: 19-67  @ ./src/app/app.module.ts  @ ./src/main.ts  @ multi webpack-dev-server / client? link ./src/main.ts

maybe I'm missing something? thank you very much, I'm with angular cli.

    
asked by DavidIjsud 14.01.2018 в 16:08
source

1 answer

1

the error says that the module "hijo.component.ts" could not be found.

  • Make sure you are importing the decoder input from @ angular / core correctly as follows:

import { Component, Input } from '@angular/core;
  • make sure you are sending the data correctly from the parent component to the child component like this:

<mi-directvia [mi-variable]="mi-valor"></mi-directvia>
  • make sure you are importing both components and adding them to the array of "declarations" in the app.module.js file
answered by 14.01.2018 / 17:04
source