This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Feature request: Ability to set value type for scope values imported from attributes #9279
Open
Description
In my Directives I would love to be able to specify that value coming from an attribute is of type boolean or number or perhaps even Date. Ideally I see it as an enhancement to your syntax where when you set scope hash you can also specify the type. For example:
scope: {
myNumber: '#@', //Where # would attempt to cast value to Number
myBoolean: '!@', //Where ! would attempt to cast value to Boolean
}
Rational for this is that very often I end up doing something like $scope.myValue === 'true' instead of just testing for its intended type.