Attributes and Parameters with Angular Translate

translate-values="{map}" translate-value-myargument="{string}" translate-attr-myattribute="{string}" translate-value-{argument-name} values are available in the translation by name. translate-attr-{attribute-name} creates the attribute attribute-name with the translation as value. The map feature is potentially critical, cause a value of the map could potentially escape its cage and inject some Java Script. Example: i18n JSON: {"TRANSLATE_THIS_KEY": "My argument has the value '{{myargument}}'"} Markup: <div></div> Result: My argument has the value ‘something creative’...

May 13, 2016 · 1 min · Markus Ruepp

angular watch expressions for nested fields with special charaters

If you have model names that contain reserved keywords like operators, watch expression in the dot notation will fail. Luckily these names can be escaped. $scope.$watch('metadataForm["dublincore/episode__isPartOf"]', function(modelCtrl) { ... }) ...

April 4, 2016 · 1 min · Markus Ruepp