No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 1 commit ahead of learn-co-students:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
js
tests
.gitignore
.learn
CONTRIBUTING.md
LICENSE.md
README.md
index.html
karma.conf.js
package.json

README.md

Create a Service structure

Objectives

  • Write a custom Service
  • Use the custom Service in Controller

Instructions

Let's write our own service to do some basic math.

Using the existing directory structure, we've got a controller that's trying to call a service that doesn't exist yet, named MathService. Create that service in js/app/services/MathService.js.

Our controller is trying to call MathService.sum() with an array of numbers, expecting it to return the sum of all those numbers. Create this method, then see if it displays the sum correctly!