我的角度 HTML 中有一个三元运算符。我在格式化时遇到困难。如果该值等于文件长度,它应该返回Good,如果不是我需要检查一些自定义值。我检查自定义值是否存在 ( customs?.album_title),然后确定要显示的内容。如果两个选项都是字符串,它完全可以正常工作。但是,我需要My Text预先设置customs.album_title值,但我不完全确定该怎么做。正如您在下面的示例中看到的(这自然是不正确的),结果将是customs?.album_title一个字符串,与My Text+ 相对,无论customs.album_title值是什么。
任何帮助将不胜感激。
{{ value == files.length ? 'Good' : customs?.album_title ? 'My Text customs.album_title' : 'String Two' }}