feat(ivy): add AttributeMarker.I18n for i18n attributes (#30402)

`i18nAttributes` instructions always occur after the element instruction. This means that we need to treat `i18n-` attributes differently.
By defining a specific `AttributeMarker` we can ensure that we won't trigger directive inputs with untranslated attribute values.

FW-1332 #resolve
PR Close #30402
This commit is contained in:
Olivier Combe
2019-05-15 17:08:50 +02:00
committed by Matias Niemelä
parent 91699259b2
commit 53c6b78c51
6 changed files with 79 additions and 41 deletions

View File

@ -109,8 +109,9 @@ export function attrsStylingIndexOf(attrs: TAttributes, startIndex: number): num
* attribute values in a `TAttributes` array are only the names of attributes,
* and not name-value pairs.
* @param marker The attribute marker to test.
* @returns true if the marker is a "name-only" marker (e.g. `Bindings` or `Template`).
* @returns true if the marker is a "name-only" marker (e.g. `Bindings`, `Template` or `I18n`).
*/
export function isNameOnlyAttributeMarker(marker: string | AttributeMarker | CssSelector) {
return marker === AttributeMarker.Bindings || marker === AttributeMarker.Template;
return marker === AttributeMarker.Bindings || marker === AttributeMarker.Template ||
marker === AttributeMarker.I18n;
}