If I am writing my own directives I usually just stick it in a 
myComponent.directive.js file in the directory that it associates to. Then 
I add script block to the main file to load it (index.html). I am just 
figuring all this out myself, so I feel your pain. I have a "hello world" 
type app I am building that might help you get on the right path.

https://github.com/robertz/D3Compare

There is a link to the app on the github repo, so you don't have to install 
anything to see it work..


On Monday, November 2, 2015 at 11:16:02 AM UTC-5, Dave Abbott wrote:
>
> First attempt at this and every tutorial I find the code / structure is 
> all different so it makes it even worse. And everything as usual is in a 
> single app.js file so thats no help either.
>
> Basically there will be a lot of directives created to avoid the 
> ng-controller usage. 
>
> But how is a simple say userName directive written and saved in the 
> directives folder? 
>
> Where we drop <user-name></user-name> in a view and populate it with data 
> from and API call. That's as basic real world I can think of
>
> Do you need to load it in app.js :
> angular.module('app', [
>     'ngRoute',
>     'ngResource',
>     'ngStorage',
>     'appRoutes',
>     'userName',
>     .....500 other directives?
>   
>   ])
>
> All files are combined / minified 
>
> I really wish there was a real example of usage, naming conventions, 
> folder structure, its all do it how ever, and there are guides to follow 
> then the tutorials don't follow, don't say file names, where they are 
> saved, how they are loaded if loaded and where....
>
> For the <user-name> directive in guides half are prefixed with 
> my-app-[directive name] other just directive-name, no reason noted why? 
> Other directive function names are myAppUserList function() then others are 
> userList function() why do people use myApp prefix naming? Is it supposed 
> to be there? If so where is this noted / docs? 
>
> I thought a framework as with any thing "structured" would have a common 
> design pattern to follow. 
> To me it seems like a pre-fabricated house that you can put together and 
> if you like put the doors on the ceiling and windows on the floor, you 
> probably should not but you can if you want type attitude.
>
>

-- 
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