简体   繁体   English

未捕获的错误:模板解析错误:无法绑定到“配置文件”,因为它不是“ app-trnmnt-name”的已知属性

[英]Uncaught Error: Template parse errors: Can't bind to 'profiles' since it isn't a known property of 'app-trnmnt-name'

My error 我的错误

compiler.js:1021 Uncaught Error: Template parse errors:
Can't bind to 'profiles' since it isn't a known property of 'app-trnmnt-name'.
1. If 'app-trnmnt-name' is an Angular component and it has 'profiles' input, then verify that it is part of this module.
2. If 'app-trnmnt-name' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. (""../../assets/imgs/Coverr.jpg" width="1600px" height="500px">
 <app-cup></app-cup>
<app-trnmnt-name [ERROR ->][profiles]="title"></app-trnmnt-name>
<app-sprt-type></app-sprt-type>
<app-trnmnt-type></app-trnmnt-t"): ng:///AppModule/CoverComponent.html@4:17
    at syntaxError (compiler.js:1021)
    at TemplateParser.push../node_modules/@angular/compiler/fesm5/compiler.js.TemplateParser.parse (compiler.js:14830)
    at JitCompiler.push../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._parseTemplate (compiler.js:24018)
    at JitCompiler.push../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileTemplate (compiler.js:24005)
    at compiler.js:23948
    at Set.forEach (<anonymous>)
    at JitCompiler.push../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileComponents (compiler.js:23948)
    at compiler.js:23858
    at Object.then (compiler.js:1012)
    at JitCompiler.push../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileModuleAndComponents (compiler.js:23857)

my data can not be link with other component i get data from profile.component.ts and made diffent component like tornamnt name tournamnt type and all i connect my tournamnet name component to cover component by to html of cover.component 我的数据无法与其他组件链接,我从profile.component.ts获取数据,并制作了不同的组件,例如tornamnt名称tournamnt类型,所有这些我都将我的tournamnet名称组件连接到cover.component的html的Covering组件

i want to get data from profile.component.ts to cover.ts 我想从profile.component.ts到cover.ts中获取数据

following are my files 以下是我的文件

trnmntName.component.ts trnmntName.component.ts

import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-trnmnt-name',
  templateUrl: './trnmnt-name.component.html',
  styleUrls: ['./trnmnt-name.component.css']
})
export class TrnmntNameComponent implements OnInit {

  constructor() { }
  Title="Tournament Name";
  ngOnInit() {
  }

}

profile.component.ts profile.component.ts

import { Component, OnInit,Input } from '@angular/core';
import {ProfileService} from '../profile.service'
@Component({
  selector: 'app-profile',
  templateUrl: './profile.component.html',
  styleUrls: ['./profile.component.css']
})
@Input()
export class ProfileComponent implements OnInit {

  @Input() public profiles;
  constructor(public profservice:ProfileService) { }

  ngOnInit() {

    this.profservice.getProfile()
    .subscribe(data => {
      console.log(data)
      this.profiles =data
    });

  }

}

cover.component.html cover.component.html

<div class="cover">
  <!-- <a href ="http://one-louve-dev.appspot.com/search">  -->
 <img src="../../assets/imgs/Coverr.jpg" width="1600px" height="500px">
 <app-cup></app-cup>
<app-trnmnt-name [profiles]="title"></app-trnmnt-name>
<app-sprt-type></app-sprt-type>
<app-trnmnt-type></app-trnmnt-type>
<app-date-location></app-date-location>









</div>

Add the input property profile to app-trnmnt-name component. 将输入属性概要文件添加到app-trnmnt-name组件。

export class TrnmntNameComponent implements OnInit {

  @Input()
  profiles: Your_data_type

  constructor() { }
  Title="Tournament Name";
  ngOnInit() {
  }

}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:模板解析错误:无法绑定到“选项”,因为它不是“图表”的已知属性 - Error: Template parse errors: Can't bind to 'options' since it isn't a known property of 'chart' Angular 6 日历模板解析错误:无法绑定到“视图”,因为它不是“div”的已知属性 - Angular 6 Calendar Template parse errors: Can't bind to 'view' since it isn't a known property of 'div' NG2-Charts模板解析错误:无法绑定到“数据集”,因为它不是“ canvas”的已知属性 - NG2-Charts Template parse errors: Can't bind to 'datasets' since it isn't a known property of 'canvas' 错误:无法绑定到“ ngModel”,因为它不是的已知属性 - Error: Can't bind to 'ngModel' since it isn't a known property of 在控制台中出现错误无法绑定到“ngif”,因为它不是 angular 应用程序中“div”的已知属性 - Getting error in console Can't bind to 'ngif' since it isn't a known property of 'div' in angular app 无法绑定到“控件”,因为它不是(myComponent)的已知属性 - Can't bind to 'control' since it isn't a known property of (myComponent) 无法绑定到“ useStickyClasses”,因为它不是“ div”的已知属性 - Can't bind to 'useStickyClasses' since it isn't a known property of 'div' Angular 7:无法绑定到“元素”,因为它不是 - Angular 7 : Can't bind to 'element' since it isn't a known property of 无法绑定到“matMenuTrigger”,因为它不是“a”的已知属性 - Can't bind to 'matMenuTrigger' since it isn't a known property of 'a' 无法绑定到“ngModel”,因为它不是“输入”的已知属性 - Can't bind to 'ngModel' since it isn't a known property of 'input'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM