2018-10-22         Dominic

How can I show the data for only selected check box

Here I want to show Name, Country values through $http, The data is showing in the table this is fine, but when I check any check box in that table I want to display Name, Country values of that selected checkbox. How can I do that?var app = angular.module("myApp", []);app.controller("homeCtrl", function($scope, $http) { $http.get("https://www.w3schools.com/angular/customers.php").then(function(response) { $scope.myData = response.data.records; }); $scope.showDetails = function(indexVal, values) { var getDataValue = {}; if (values) { alert($scope.myData.rec...

 angularjs                     1 answers                     21 view
 2018-10-22         Susan

Angularjs File upload + change the filename

I am using the angularjs file upload and using the following package.http://nervgh.github.io/pages/angular-file-upload/examples/simple/Backend I am using loopback framework, The file upload & file save is working fine , but I unable to rename the file.For example I upload abcd.img means I try to save based on time or some other. Like abc328767382.jpg, because same file name but different image possible to upload .Have any options for this? Is this helpful ?uploader.addToQueue(fileHandle, {alias: "someName"});Given that FileItem has the property alias [XXX]

 angularjs                     1 answers                     9 view
 2018-10-22         Mick

How to broadcast event between two controllers in AngularJS

I have two controllers and try to send an event by using below code from controller A:$scope.$watch("showContextFooter", function (newValue, oldValue) { $rootScope.$broadcast('contextFooterChange', {isOpen: $scope.showContextFooter}); });in controller B i am trying to catch this event by this way:$rootScope.$on('contextFooterChange', function(data){ $log.info(data); });//OR $scope.$on("$destroy",$scope.$on("contextFooterChange", function (e) { $log.info(e); }));but not getting any event in controller B. i try to debug and see that controller...

 angularjs                     2 answers                     11 view
 2018-10-22         Ula

How to pre-select a default option in ng-options using $scope variable

I have a <select> in a form with other fields, like so-<form class="formCSS"> <div class="inputs"> <label class="labelTag">Name *: &nbsp&nbsp</label> <select class="inputTag" ng-model="selectedName" ng-options="n.name for n in adminNames"></select> </div></form>adminChannels is an object array of this structure {_id:"....", name:"..."}When I "transitionTo" this state, I pass a name (which exists in adminNames too) like so - $state.go('schedule',{name:response.name});I want the said name (accessed...

 angularjs                     2 answers                     12 view
 2018-10-22         Ruby

ngRoute don't display view with in ngView

I'm starting with a basic app with c# web api + AngularJS. I'm using AngularJS ngRoute for routing. The page is perfectly loaded, and the code in the secondary files is displayed correctly. The problem is with the file (or code) templated with ngRoute... here is my code...my app.js:var App = angular.module('App', ['ngRoute']);// configure our routesApp.config(function ($routeProvider) { $routeProvider // route for the home page .when('/', { templateUrl: 'views/home.html' }) .otherwise({ redirectTo: '/' }); $locationProvider.html5...

 angularjs                     1 answers                     13 view
 2018-10-22         Samantha

angular $routeProvider does not work with spring boot

Now, I want to convert an jsp and Spring boot an application to AngularJS 1.6, HTML, and Spring boot based application. Then I met some issues with routing.HTML files are under main/resources/static/viewI create a controller to handle routing and it works well. For other CRUD operation, I have created corresponding rest api.:@Controllerpublic class IndexController { @Autowired UserService userService; @RequestMapping(path = {"/", "/index"}, method = {RequestMethod.GET, RequestMethod.POST}) public String index(Model model, @RequestParam(val...

 angularjs                     1 answers                     15 view
 2018-10-22         William

AngularJS + Elasticsearch - How to search for documents

I am using AngularJS with ElasticSearch. Until now I have been playing around with ElasticSearch using the curl command in my terminal. Now, I wish to perform a search in AngularJS on my elastic search indices. How do I do it? I assume using $http.get() but I could not find an example anywhere. Basically, how do I convert the following:curl -XGET 'http://localhost:9200/twitter/mark/_search?pretty=true&size=100' -d '{ "term": { "tag": "comedy" }}'to an Angular request? That is how do I achieve the above in AngularJS inside my controller? Elasticsearch ...

 angularjs                     1 answers                     19 view
 2018-10-22         Violet

wait for scope evaluation protractor

Consider this simple protractor test:<body> <div ng-app="test2App" ng-controller="test2Ctrl"> <input ng-model="myValue"> </div></body>var test2App = angular.module('test2App', [])test2App.controller('test2Ctrl', function($scope,$timeout) { $timeout(function() { $scope.myValue = true; },10000);});describe('my suite',function() { it('wait for a model to be defined',function() { element(by.model('myValue')).evaluate('myValue') .then(function(v) { expect(v).toBe(true); }); });});Is ther...

 angularjs                     1 answers                     81 view
 2018-10-22         Phoebe

AngularJS + Protractor How to select Dropdown option based on its text not value

I want to click on item by it's text and not by it's value from dropdown box.i found this great post : https://coderwall.com/p/tjx5zg but it doesn't work as expected, the search continue forever after match was found and it is not clicking the item,if someone have better example (a working one) or can fix this code and make it work, i will apperciate.This is the code Dan Haller from the post used (all rights reserved to him)function selectOption(selector, item){ var selectList, desiredOption; selectList = this.findElement(selector); selectList.click(); selectLis...

 angularjs                     3 answers                     86 view
 2018-10-22         Winston

how to use bootstrap card columns properly?

I have an angularjs webpage with bootstrap. I'm trying to use bootstrap cards. I selected bootstrap card-columns class but i got a problem. In adding fourth one, sequance will change to card-colums: 2 but its default card-colums: 3.At JSFiddle https://jsfiddle.net/fdbwyoc7angular.module("app", []).controller("bdCtrl", function($scope) { $scope.cards = [{}]; $scope.appendCard = function() { $scope.cards.push({}); };});<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet"/><script src="https://ajax.googleapis.com...

 angularjs                     2 answers                     18 view
 2018-10-22         Chester

AngularJs <md-menu-content> doesn't get closed when clicking outside the menu

I have implemented a angular js menu referring this article and my menu item contains a sub menu as well. When I keep the mouse on the menu item the sub menu opens, but when I move the mouse to another menu item or when I click somewhere else in the window ( except the menu area ) the sub menu item doesn't get closed.When I move the mouse on the menu itemWhen I click out side the menu itemHere is the code for menu<md-list-item> <md-menu md-position-mode="cascade" > <a class="w3-button w3-block w3-flat-clouds w3-left-align menu-button" ng-href="#...

 angularjs                     1 answers                     51 view
 2018-10-22         Norton

aws-amplify authentication login timeout using AUTH angular

When using Aws-amplify how do i set the user login time out, Do i have to create a timeout mechanism with this -> i.e. a custom timeout then just log the user out. https://docs.angularjs.org/api/ng/service/$timeoutIs this not a feature not sure if this applies. https://github.com/aws-amplify/amplify-js/issues/368I see the analytics has a session manager with a timeout that is fixed. https://github.com/mbahar/aws-amplify/blob/986a9ec4/packages/aws-amplify/src/Analytics/SessionManage.ts#L19In Auth.ts there is a user, expires_atCredentials.set({ provider, token, identity_id, u...

 angularjs                     1 answers                     26 view
 2018-10-22         Dana

Adal.js Token refresh issue in Angular

Refresh token is not working as I expected in adal.js(@types - 1.0.8), When user is idle on screen for last 15 minutes (because I refresh token before 15 minutes of expiry of old token), and after that perform action, then my service call fail. because it gets old token(which expire) in header, but token refresh is also done after that. how I can handle this in angularJS and adal library? I used below code to get refresh tokenthis.authenticationContext.getCachedUser(); this.authenticationContext.acquireToken(config.clientId, function (errorDesc, token) { if (error...

 angularjs                     1 answers                     18 view
 2018-10-22         Iris

Azure mobile service ".login('facebook')" calls error callback after logged in successfully?

I have the following code which uses WindowsAzure.MobileServiceClient and it works when testing in browser (Ripple). In Ripple(browser), the page redirects to ($state.go('menu.events')) after logged in as expected..controller('LoginCtrl', ['$scope', '$state', 'client', function ($scope, $state, client) { $scope.loginFacebook = function () { console.log('loginFacebook...') client.login("facebook").then(function (data){ console.log('logged in succesfully..') $state.go('menu.events'); }, function(error){ console.log('log...

 angularjs                     1 answers                     1 view
 2018-10-22         Verna

how to refresh token when expired in jwt

I am implementing JWT in my project. I implemented jwt and gave it an expiration time of 1 minute. The jwt that is generated from the api side is during login and the token and expiration details are sent in the result and are stored in local storage. How can I refresh the expired token from API side and send it back again to the client so that it can be stored in local storage and sent for every call using interceptor?this is how I created jwt and gave expiration time// let us suppose this is my inputtokenObject = { User: { username: name, pwd: pwd } };//creating a jwt her...

 angularjs                     2 answers                     47 view
 2018-10-22         Leif

How can I solve this error in nano (couchdb) Express.js

(node:7636) UnhandledPromiseRejectionWarning: Error: Can't set headers after they are sent. at validateHeader (_http_outgoing.js:491:11) at ServerResponse.setHeader (_http_outgoing.js:498:3) at ServerResponse.header (C:\Users\username\path\Express\node_modules\express\lib\response.js:767:10) at ServerResponse.send (C:\Users\username\path\Express\node_modules\express\lib\response.js:170:12) at ServerResponse.json (C:\Users\username\path\Express\node_modules\express\lib\response.js:267:15) at ServerResponse.send (C:\Users\username\path\Express\...

 angularjs                     1 answers                     93 view

Page 1 of 610  |  Show More Pages:  Top Prev Next Last