I'm using node.js + express(server side) and angularjs + requirejs(client 
side) and i understood everything about what you said Samuel, thanks for 
your help.

Em quarta-feira, 8 de janeiro de 2014 16h52min37s UTC-3, Samuel Ytterbrink 
escreveu:
>
> Yes!
>
> You can use directives as if you where using any other way of loading your 
> scripts. Though make sure you have loaded them all before you bootstrap the 
> application.
>
> I don't fully understand your design. But the basics are that you don't 
> need the router if you are not doing a one-page-app. But basically you 
> could have many pages with there own mini router to only manage a small set 
> of views.
>
> If i where you i would ask myself:
>  * How are my app going to be used.
>  * What type of server are im going to write with express (great choice 
> btw).
>  * What things can i do without.
>
> It seams to me that you have started with way to many unfamiliar 
> technologies at one same time.
>
> It might help you to configure express to only serve static content and 
> build a prototype with only static pages and the angular router. It will be 
> enough to get a feel for angular and what you want to build. Then you can 
> pick a path from there. To load new pages or json form express.
>
> When having such a amazing back-end it sounds to me a little loony to not 
> send data as json and serve static html (angular templates). The only 
> strong argument against it that I see is that its harder to make a page 
> like that index correctly for a search engine crawler.
>
> And if you can remove anything from your stack in a first attempt, do so!
>
>
> 2014/1/8 Rodrigo F. <[email protected] <javascript:>>
>
>> Ok, i think i'm confused(i'm using angular just in 2 days...), i know 
>> that i need to manually bootstrap angular and i did that, so one question, 
>> using requirejs can i use directives like ng-controller in my html element? 
>>  And another question, angular routers work with express? Or they are just 
>> used to single web app and work with expresses through ajax? Because i want 
>> to use router, but the client have to connect with server directly and 
>> refresh the page...
>>
>> Em quarta-feira, 8 de janeiro de 2014 13h45min30s UTC-3, Samuel 
>> Ytterbrink escreveu:
>>>
>>> I think you confuse your self with 2 different things.
>>>
>>> The only thing that changes when using Requirejs and/or any other AMD 
>>> module-system is that you need to manualy bootstrap angular.
>>>
>>> You need to make sure that all the angular code are loaded before this 
>>> (you can use Requirejs domready and its dependency system). Then you just 
>>> run angular.bootstrap(<element>, "<module_name>") and your good to go. This 
>>> is instead of using the ng-app directive on the element you use as element 
>>> root for the application.
>>>
>>> If you cant use directives after this in your application then its not 
>>> that you use Requirejs that is the problem. And for us to be able to help 
>>> you in that case you need to give us more info about your application.
>>>
>>> PS. your backend have nothing to do with this problem.
>>>
>>>
>>> 2014/1/8 Rodrigo F. <[email protected]>
>>>
>>>> Samuel Ytterbrink,
>>>>
>>>>  I've seen this tutorial before and they just bind the angular 
>>>> controller with html through angular route.
>>>>  
>>>> -- 
>>>> 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/O6MtAWnPJuQ/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/groups/opt_out.
>>>>
>>>
>>>
>>>
>>> -- 
>>> Samuel Ytterbrink
>>>  
>>  -- 
>> 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/O6MtAWnPJuQ/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/angular.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> Samuel Ytterbrink
>  

-- 
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/groups/opt_out.

Reply via email to