问题描述: 在使用ASP.NET Core Angular模板开发应用程序时,发现在运行ng build --prod命令后,组件的样式并没有应用到生成的应用程序中。
解决方法:
import './my-component.component.css';
@Component({
selector: 'app-my-component',
templateUrl: './my-component.component.html',
styleUrls: ['./my-component.component.css']
})
"styles": [
"src/styles.css",
"src/app/my-component/my-component.component.css"
],
ng build --prod --configuration=production
以上是一些解决ASP.NET Core Angular模板中组件样式不被应用的方法。根据具体情况,您可能需要结合实际代码进行调整。