GithubHelp home page GithubHelp logo

angular-dark-sky's Introduction

deanbot.helloWorld();

#=============
#            ########################
#    _|__   ## Hello [๐ŸŒ,๐ŸŒŽ,๐ŸŒ]! ##
#   ((O O) ########################
#    | --|
#   /  ===\
#=============

man deanbot

Friendly developer specializing in modern js and cloud services.

Find him on the web:

angular-dark-sky's People

Contributors

deanbot avatar k-funk avatar mserralta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

angular-dark-sky's Issues

jsonp not working

Is this working for you? I have to change the jsonp to get in the fetch method.

JSON_CALLBACK parameter is not allowed

Hi there! New in angular, so maybe I amb getting lost in some point.

According to Angular Documentation: https://docs.angularjs.org/error/$http/badjsonp callback parameter is not longer accepted in JSONP calls.

So I did need to change the line 310 of the library:

url = [config.baseUri, apiKey, '/', latitude, ',', longitude, time, '?units=', units, '&lang=', language, query, '&callback=JSON_CALLBACK'].join('');

to

url = [config.baseUri, apiKey, '/', latitude, ',', longitude, time, '?units=', units, '&lang=', language, query].join('');

(

url = [config.baseUri, apiKey, '/', latitude, ',', longitude, time, '?units=', units, '&lang=', language, query, '&callback=JSON_CALLBACK'].join('');
)

Maybe you would need to check angular version before this call?

angular-dark-sky.js:259 Uncaught ReferenceError: _ is not defined(โ€ฆ)

hi,

I got this error:
angular-dark-sky.js:259 Uncaught ReferenceError: _ is not defined(โ€ฆ)
and
angular-dark-sky.js:260 Uncaught TypeError: _.join is not a function(โ€ฆ)

I googled for some solution and I add underscore lib:

<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore.js"></script>

but seems not to work!
any idea?

unable to parse data ?

Hello,
I try to use your API but there seems to be an issue while parsing data from the darksky side if I am doing everything right on my side. May be an API change from their side ?

See test below.

Also, it may be useful to add such a simple test file in the repo to provide guidance for first users.

<!doctype html>

<title>Test</title> <script src="https://code.angularjs.org/1.5.3/angular.min.js"></script> <script src="angular-dark-sky.min.js"></script> <script> var app = angular.module('test', ['dark-sky']); app.config(['darkSkyProvider', function(darkSkyProvider) { darkSkyProvider.setApiKey('df2d7141740701587a1cde5b5d340379'); }]); app.controller('weatherController', WeatherCtrl); WeatherCtrl.$inject = ['$q', 'darkSky']; function WeatherCtrl($q, darkSky) { activate(); // log current weather data function activate() { getNavigatorCoords() .then(function(position) { darkSky.getCurrent(position.latitude, position.longitude) .then(console.log) .catch(console.warn); }) .catch(console.warn); } // Get current location coordinates if supported by browser function getNavigatorCoords() { var deferred = $q.defer(); // check for browser support if ("geolocation" in navigator) { // get position / prompt for access navigator.geolocation.getCurrentPosition(function(position) { deferred.resolve(position.coords); }); } else { deferred.reject('geolocation not supported'); } return deferred.promise; } }; </script>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.