i am sorry, i am still lost in terms what you are trying to describe. Code
sample would be me more descriptive.

I am not sure how is this a problem, i am yet to find camelCase in
directive's angular('module').directive('camelCase',[function(){}])
introducing any issues for me to write it as <div camel-case></div> or
<camel-case></camel-case>. I agree it is a bit offsetting in begging. But
beyond this initial getting to know angular, i have not had any issues with
this.










On Thu, Apr 10, 2014 at 2:38 PM, Nick Retallack <[email protected]>wrote:

> Well I suppose you can't *not* create directives dynamically, but what I
> mean is, I'm creating several of them in a loop, the same way it is done in
> several places the angular source code.  Then I'm creating another
> directive that contains a switch statement between the dynamically created
> ones.  To embed the directives into the switch statement, I had to copy the
> camelCase/snake_case functions from the angular source code, since they
> aren't accessible.  I realize I could have just made this be one directive
> with a single massive template.  Anyway, that is all irrelevant to my point.
>
> I'm just trying to say it's silly to have to name directives in camelCase
> when you have to use them in snake-case.  Why don't we just use snake-case
> all along?  This could be supported without dropping backward
> compatibility.  If the name is already in snake case, don't change it.
>  Convert it to camelCase internally if you need to.
>
> On Wednesday, April 9, 2014 2:17:13 PM UTC-7, Nick Retallack wrote:
>>
>> Today I tried to dynamically create and use some directives at runtime.
>>  Then I realized I have to spell them differently when I create them from
>> when I use them.  This is silly.  Now I have to procedurally translate them
>> between camelCase and snake-case myself.
>>
>> One of my previous co-workers also thought this was stupid.  He was
>> looking at my angular templates and then trying to grep the source code for
>> where those attributes are used.  If I were using jQuery, those attributes
>> would have shown up in the source code in selectors.  But since it's
>> angular, they were camelCased, and thus un-greppable.
>>
>> Being able to grep your source code for identifiers is one of those
>> unspoken rules of software development, isn't it?
>>
>> Since a directive's name is just a string, why can't we just write it the
>> way it is going to appear, in snake-case?  I've heard the argument that it
>> needs to be a valid JavaScript identifier, but when is it ever interpreted
>> in JavaScript?  Angular is moving toward Polymer anyway, and in Polymer you
>> have to name tags with dashes in them in the first place.
>>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "AngularJS" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/angular/CMBzQc9-GUk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to