AngularJS Quiz App Tutorial (7/24) - AngularJS Factories and Services

AngularJS Quiz App Tutorial (7/24) - AngularJS Factories and Services
AngularJS Quiz App Tutorial (7/24) - AngularJS Factories and Services
Title : AngularJS Quiz App Tutorial (7/24) - AngularJS Factories and Services
Duration : 10:10
Channel : Hungry Turtle Code
Label : angular, angularjs, angular services, angular factory, hungryturtlecode, hungry turtle code, Adrian Henry, angular quiz app
AngularJS Quiz App Tutorial (7/24) - AngularJS Factories and Services
AngularJS Quiz App Tutorial (7/24) - AngularJS Factories and Services
AngularJS Quiz App Tutorial (7/24) - AngularJS Factories and Services
AngularJS Quiz App Tutorial (7/24) - AngularJS Factories and Services

The writeup for this video: https://hungryturtlecode.com/code-projects/angular-quiz-app/7-angular-services/?utm_source=YouTube&utm_medium=VideoDescription&utm_campaign=quizapp7 Part 1 of this series: https://www.youtube.com/watch?v=yordL7Yczes&index=1&list=PLqr0oBkln1FBmOjK24_B4y_VAA8736wPq The Git Repo for this project: https://github.com/adiman9/HungryTurtleFactQuiz Now that we have finished out list controller we can move on and start creating our quiz controller. We used a property on our list controller called quizActive to show and hide the list controller markup. Logically, we will also use that property to do the opposite to the quiz controller markup as we want that to show when the list hides. Unfortunately, we will run into a problem when we try to do this with angular. Angular will not allow us to communicate between our controllers directly, so we will not have access to the quizActive property on our list controller when we are inside the quiz controller. Fortunately, the AngularJS team realised we will want to share data and functionality between controllers and gave us something called services. These allow you to reuse code in many controllers without having to actually repeat the code. The service we are going to focus on is called a factory. In this video we will build our first factory that will allow us to share properties between controllers. This is done by injecting the factory in both of the controllers and this will allow both controllers access to what is inside that factory. Check Out The Site! https://hungryturtlecode.com/?utm_source=YouTube&utm_medium=VideoDescription&utm_campaign=quizapp7 SUBSCRIBE! http://www.youtube.com/hungryturtledev?sub_confirmation=1 Join the Community! Hungry Turtle Code Follow Me -- https://twitter.com/hungryturtledev Like Me -- https://www.facebook.com/hungryturtlecode/ Circle Me -- https://plus.google.com/+Hungryturtledev Instagram -- https://www.instagram.com/hungryturtlecode/ Pinterest -- https://www.pinterest.com/hungryturtledev/ linkedin -- https://www.linkedin.com/company/hungry-turtle-code Github -- https://github.com/adiman9



Share this

Related Posts

Previous
Next Post »