Search Posts

Category: api

show rest api json response like textbox autopopulate using angular js

how to show rest api json response like textbox autopopulate using angular js I’m accessing address lookup rest API service – JSON response. I want to show my JSON response like auto-dropdown list. Rest service result has 5 JSON array list for all my search but in my below code that JSON result again filter based on the value entered in the textbox. http://jsfiddle.net/3etbtfwL/230/ Test Case# 1) Entered ‘google’ in textbox rest service returns 5 […]

ng serve Unable to find "@angular/cli" in devDependencies

$ ng serve Unable to find “@angular/cli” in devDependencies. Please take the following steps to avoid issues: “npm install –save-dev @angular/[email protected]” You seem to not be depending on “@angular/core”. This is an error. in the backend(symfony) is run corretly but I had this error in angular js frontend when i want to run my server can someone have a idea why and how i solve Source: AngularJS

Nothing adding in list display and database symfony/angular js

When I add my form (angularjs) nothing in list display and database MySQL I don’t know what’s wrong.Is someone know the problem? User.controller(symfony) namespace AppBundleControllerApi; use AppBundleEntityUser; use SymfonyBundleFrameworkBundleControllerController; use SensioBundleFrameworkExtraBundleConfigurationMethod; use SensioBundleFrameworkExtraBundleConfigurationRoute; use SymfonyComponentHttpFoundationRequest; use SymfonyComponentHttpFoundationResponse; use AppBundleServiceValidate; use SymfonyComponentHttpFoundationJsonResponse; use NelmioApiDocBundleAnnotationApiDoc; class UserController extends Controller { /** * @ApiDoc( * resource=true, * description=”Get the list users”, * section=”users” * ) * * @Route(“/api/users”,name=”list_users”) * @Method({“GET”}) */ public function listUser() { $users=$this->getDoctrine()->getRepository(‘AppBundle:User’)->findAll(); if (!count($users)){ […]

Change the 20 object limit from API call using AngularJS

I’m making a get request to one of NASA’s API’s, but the response is limited to 20 objects. I’d like to change this number, but I can’t figure out how. function makeRequest() { return $http({ method: “GET”, url: “https://api.nasa.gov/neo/rest/v1/neo/browse?api_key=WJqgdCXy65yXJVQE6Se8wR4TmyDe6SqNONYiN4ef” }).then(function(response) { asteroidData = response; console.log(asteroidData); }); } I’ve tried chaining “&count=35” onto the end of the URL, but that didn’t work. Also if you want to play around with the API call in GitBash, here’s […]

Authenticate all Request to REST API with no username/password to get any token

I am selling products, API fetch product from node back-end and show on angular front-end, Back-end is centralized and angular front-end is on multiple domain, I need to authenticate all request made from my angular front-end to node back-end. Users d’t have account. I need to make sure no one else copy the product data via POSTMAN or other services. JWT is not working as request are exposed so token can be copied so authentication […]

Getting Access-Control-Allow-Headers in preflight error

I have created angular js app in which I have integrate twitch api , the api is return $http({ url: “https://api.twitch.tv/kraken/streams”, method: “GET”, params: { channel: channel, limit: 1 }, headers: { “Client-Id”: “XXXXXXXXXXXXXXX” } }) the problem is when I reload the page the api is working but when my state changes without page reload I am getting cross origin error from this api. the error is Failed to load https://api.twitch.tv/kraken/streams?channel=eliazOne&limit=1: Request header field […]

Twitter Api return error 215 – Bad Authentication data

I’m accessing Twitter Search api into my Angular application getting following error. Implemented this change into https. Still getting same error {“errors”:[{“code”:215,”message”:”Bad Authentication data.”}]} twitter-service.js angular.module(‘TwitterServices’, [], function ($provide) { $provide.factory(‘$twitter’, function ($http, $log) { var consumerKey = encodeURIComponent(‘<consumerKey from twitter api>’); var consumerSecret = encodeURIComponent(‘<consumerSecret from twitter api>’); var credentials = Base64.encode(consumerKey + ‘:’ + consumerSecret); var twitterOauthEndpoint = $http.post( ‘https://api.twitter.com/oauth2/token’ , “grant_type=client_credentials” , { headers: { ‘Authorization’: ‘Basic ‘ + credentials, ‘Content-Type’: ‘application/x-www-form-urlencoded;charset=UTF-8’, […]

Angularjs Google Map API Integration

I’m trying to add a google map in angular JS… and have been struggling. I didn’t want to use one of the angular dependencies, but simulate the ‘async defer’ on the Google JS API site. I’m pretty new to Angularjs but get the concept of keeping things assigned to the controllers scope. Pretty sure it’s just something dumb, but not sure what… any help would be awesome 🙂 (function () { ‘use strict’; app.controller(‘travelCtrl’, [‘$scope’, […]

Next Page »