mirror of
https://github.com/Raghu-Ch/TurtleFactsQuiz.git
synced 2026-02-10 11:33:01 -05:00
dependency injection in angular /factories #services
This commit is contained in:
21
js/factories/quizmetrics.js
Normal file
21
js/factories/quizmetrics.js
Normal file
@@ -0,0 +1,21 @@
|
||||
(function () {
|
||||
|
||||
angular
|
||||
.module("turtleFacts")
|
||||
.factory("quizMetrics", QuizMetrics);
|
||||
|
||||
function QuizMetrics() {
|
||||
|
||||
var quizObj = {
|
||||
quizActive: false,
|
||||
changeState: changeState
|
||||
};
|
||||
|
||||
return quizObj;
|
||||
|
||||
function changeState(state) {
|
||||
quizObj.quizActive = state;
|
||||
}
|
||||
}
|
||||
|
||||
}) ();
|
||||
Reference in New Issue
Block a user