Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/unity3d/4.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 动态样式URL 7_Angular_Typescript_Less_Angular7 - Fatal编程技术网

Angular 动态样式URL 7

Angular 动态样式URL 7,angular,typescript,less,angular7,Angular,Typescript,Less,Angular7,对于角7中的动态载荷样式,哪种方式更好 例如,我使用这种方式,但在版本7中不工作 此外,此代码在版本7中工作 帮帮我,谢谢 function theme(): string[] { // return ['./app.component.less'] >> not find return ['/app.component.less'] } @Component({ selector: 'app-root', templateUrl: './app.compon

对于角7中的动态载荷样式,哪种方式更好 例如,我使用这种方式,但在版本7中不工作 此外,此代码在版本7中工作 帮帮我,谢谢

function theme(): string[] {
  // return ['./app.component.less'] >> not find
     return ['/app.component.less']
}

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: theme()
})

您必须提供样式URL的链接。这里我更新你的代码。请仔细看看

有关更多详细信息,请访问给定链接


您必须提供样式URL的链接。这里我更新你的代码。请仔细看看

有关更多详细信息,请访问给定链接


请看这里:谢谢
function theme(): string[] {
  // return ['./app.component.less'] >> not find
     return ['/app.component.less']
}

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})