A collection of services that pull from the Edmunds API
##Demo Plunkr
- The demo updates when the input loses focus. The function can easily be attached to a button.
##Requirements
##Installation
- Open the
edmunds-service.js
and edit this line with your API key:var key = API_KEY
- Include
edmundsApi
in your module:angular.module('myApp', ['edmundsApi']);
- Inject
edmundsService
into your controllers/directives/etc.
##Example Call:
$scope.vinLookup = function() {
if($scope.vin === undefined) { return; }
if($scope.vin.length == 17) {
var vin = $scope.vin;
edmundsService.get(vin).then(function(data) {
$scope.data = data;
});
}
}
##Services
getVin(vin)
: Get vehicle information based on the Vin givenvin
: Required. Full 17-code VIN.
getShortVin(shortVin)
: Same as getVin but accepts the shortened version of the VIN. It will do the shortening for you.shortVin
: Required. Pass in the full 17-code VIN and it will shorten the VIN for you.
getPicture(make, model, year)
: Gets pictures based on the Make, Model, and Year.make
: Required. Takes theniceName
version of the Make.model
: Required. Takes theniceName
version of the Model.year
: Required. 4-letter version of year.
getMakes(year)
: Get all car Makes.year
: Optional. Pass this value in to get Makes only from that year.
getModels(make, year)
: Get all Models for a Makemake
: Required. Takes theniceName
version of the Make.year
: Optional. Pass this value in to get Models only from that year.