ga-wdi-exercises / sweet-libs

[meta]
0 stars 12 forks source link

Basic Angular #18

Closed M00staff closed 8 years ago

M00staff commented 8 years ago

Comfort - 3

Sorry but I did tutorials all weekend so i wasn't starting from scratch, and figured this would be a really good way to hammer some things in.

Its setup and makes an AJAX request to weather underground - very basic but it works!

https://github.com/M00staff/AngularWhatUp

Ryan-321 commented 8 years ago

So did you start with your controllers in app.js and then separate them out to make your file structure more clean?

Did the tutorial this weekend to, was good stuff.

nolds9 commented 8 years ago

Love the Readme.

Code is very well documented. :+1:

Out of curiosity, I've seen different syntax's for defining the controller, do you know what the main difference is between ng-controller="myController" and ng-controller="myController as myModel"?

englep10 commented 8 years ago

Very cool. I like the simplicity of the ajax call. Do you think that there would be any differences when using a private api key? Or would the figaro gem set up be about the same?

M00staff commented 8 years ago

I just split up the controllers to make sure each worked - it made more sense that way for bug fixing.

As for the the ng-controller="myController as myModel" (I THINK) it assigns myModel as a variable (although they don't call it that - i think they call it an 'alias') so in the rest of the code you just say myModel.this and myModel.that.

M00staff commented 8 years ago

i used a private API key - it was really straightforward and awesome