ng-model, directives, transclusion, scope, wtf?

107 views
Skip to first unread message

Shelby Morris

unread,
Oct 7, 2014, 11:49:52 AM10/7/14
to ang...@googlegroups.com
Hey,

We've been working with Angular for about 6 months on a fairly large project. Recently we came into contact with some odd behavior when attempting to use ng-model in a directive. I've attached a screenshot that should sufficiently explain my confusion. What's going on? 
angular.png

Jens Melgaard

unread,
Oct 7, 2014, 12:14:27 PM10/7/14
to ang...@googlegroups.com
No that is not sufficient to explain what is going on or what your confusion is.

What it does tell me is that your not aware of what `scope: true` and 'transclude: true' actualy does, as your accessing scope.$parent allot and I could guess that your bindings are broken as well as not using ng-transclude or a transclude function to perform anything with your transcluded elements.
It seems your trying to develop a widget with quite a bit of complexity, and as your also assigning to scope directly in the widget I would suggest using an issolate scope over letting it create a child scope.

But all in all, we need allot more information

Shelby Morris

unread,
Oct 14, 2014, 4:31:16 PM10/14/14
to ang...@googlegroups.com
Actually in the screenshot, everything is working fine. I don't need any help, really, everything works smoothly. To explain a little of what I'm doing, without being condescending as you tried to be: We have peripheral devices that are added to our system and monitored by other peripheral devices. There are a variety of devices. Each device has specific properties that have to be configured, these properties are calculated by class names associated with a "types" property on their object (model). For each of the types, there is a corresponding directive. We dynamically load these directives and use them to display specific configuration options respective to their type. It's necessary to pass information to and from the directive to accomplish what we're doing. Yes, it is pretty complex. We've really pushed Angular to the limits and done things that were alleged to be incompatible with Angular. I appreciate your condescension though, your superiority is blatant and marked, unmistakable genius.

stooboo

unread,
Oct 14, 2014, 6:43:05 PM10/14/14
to ang...@googlegroups.com
FAO Shelby .. 

your reply to Jens seems unnecessarily insulting

You finished your original post with "What's going on?" ... 

so it looks like Jens tried to help .. but he also said he needed more information in order to be more helpful

Then you replied "I don't need any help" and accused him of being condescending which I can't see any evidence of 

.. maybe you're just having a 'bad day' ?

... so I'm probably not the only person wondering why you made the original post...


FAO Jens

Nice of you to try and help .. most people would be appreciative 


cheers
Stuart

Shelby Morris

unread,
Oct 14, 2014, 6:46:16 PM10/14/14
to ang...@googlegroups.com

If you can't see his condescension, that's unfortunate. My original query was not due to anything being broken, but for a clarification regarding scopes which I figured out myself. I'm having a fine day, thank you. I'm just not going to be insulted for no reason. My reply was very docile.

--
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/2IB9pErUVSI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Shelby Morris

unread,
Oct 14, 2014, 6:50:30 PM10/14/14
to ang...@googlegroups.com

Do take note of his comment (and I'm paraphrasing) that "the only thing discernible is that you don't know what you're doing." That's condescending.

Sander Elias

unread,
Oct 15, 2014, 6:47:26 AM10/15/14
to ang...@googlegroups.com
Hi Jens,

Your message is spot on!. 
Don't let one bring down your spirit. Some people just can't be helped!
Keep up the good work you are doing in our group!

Regards
Sander

Anton Trapp

unread,
Oct 16, 2014, 2:22:26 AM10/16/14
to ang...@googlegroups.com
Totally agree with Sander. Jens - thank you for trying to help. Other people would value it.

To Shelby: Many noobs (like me, not long using Angular for such a long time) are here. So if you are an expert, please make that clear in your question. Otherwise people can read and interpret it in "noob" mode. And many don't know what they are doing as they are beginning to learn/understand all the concepts. So a "you don't seem to know what you are doing" if absolutely OK for me in that context, because it is correct in many cases, especially when it comes to transcluded scopes :D

It will save all of us some time and the chance to get the answer you expected would grow.

Kind regards,
Anton
Reply all
Reply to author
Forward
0 new messages