Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 将数据传递到角度指令的语法_Angular_Dart_Angular Dart - Fatal编程技术网

Angular 将数据传递到角度指令的语法

Angular 将数据传递到角度指令的语法,angular,dart,angular-dart,Angular,Dart,Angular Dart,我得到了Angular3 Dart项目的指令: @Directive( selector: "[sample]", inputs: const ["text1", "text2"] ) class SampleDirective implements AfterContentInit { ... more code ... @Input("text1") String text1 = "Some Text 1"; @Input("text2") Str

我得到了Angular3 Dart项目的指令:

@Directive(
    selector: "[sample]",
    inputs: const ["text1", "text2"]
)
class SampleDirective implements AfterContentInit {

    ... more code ...

    @Input("text1") String text1 = "Some Text 1";
    @Input("text2") String text2 = "Some Text 2";

}
现在,当我使用此指令时:

<a-component *sample></a-component>
知道这些表达式应该如何构造吗

@Input("sampleText1") String text1 = "Some Text 1";

需要传递一个值

<a-component *sample="'someValueForSample' text1:'TESTING' "></a-component>

然后,可以添加其他输入的赋值

需要传递一个值

<a-component *sample="'someValueForSample' text1:'TESTING' "></a-component>


然后,可以添加其他输入的值分配。

给出了
ParseErrorLevel。致命:解析器错误:意外的标记:,预期的标识符,关键字,或[sample text1:'TESTING']第13列的字符串。
我确信我已经测试过了。我明天再看一看。我意识到我遗漏了这样一个变量。此外,任何辅助输入都需要以与指令相同的部分开始,因此text1:TESTING仅在我有一个名为sampleText1的输入时设置,否则它只会抛出一个致命的异常。非常好用。
给了我
ParseErrorLevel。致命:解析器错误:意外的标记:,预期的标识符,关键字,或[sample text1:'TESTING']第13列的字符串。
我确信我已经测试过了。我明天再看一看。我意识到我遗漏了这样一个变量。此外,任何辅助输入都需要以与指令相同的部分开始,因此text1:TESTING仅在我有一个名为sampleText1的输入时设置,否则它只会抛出一个致命的异常。使用起来很方便。
<a-component *sample="text1:'TESTING' "></a-component>
<template sample [sampleText1]="'TESTING'">
  <a-component></a-component>
</template>
@Input() 
String sample;
<a-component *sample="'someValueForSample' text1:'TESTING' "></a-component>