Questions tagged [angularjs]

89866 questions
1

votes
1

answer
69

Views

How to assign Enum to variable?

The title says it all: how do I assign an Enum to a local variable like: export enum MyEnum { TOP = 'top', RIGHT = 'right', BOTTOM = 'bottom', LEFT = 'left' }; const myEnum: MyEnum = MyEnum; //
scipper
0

votes
0

answer
4

Views

Can't set checkbox checked inside AngularJs template

I'm using a bootstrap dropdown to filter a long list of items for a multi-select operation. The code generates a control like this: While I am able to capture the checked items using the typeahead-on-select attribute to run a function which captures selected items, I cant get the checkboxes thems...
user1023110
0

votes
2

answer
13

Views

Iterate through a groupby array of json

I have an array of JSON object as follows var array = [{'id':'1','value': '13'},{'id':'2','value': '23'},{'id':'1','value': '33'},{'id':'3','value': '13'}] Then I grouped the json array according to the id as follows var groupArray = {'1':[{'id':'1','value': '13'},{'id':'1','value': '33'}], '2': [{'...
tharindu
1

votes
1

answer
28

Views

Component not accepting camelCase names

My issue here lie with me trying to make a navbar component, some data must be shared from the main page to the component, and while spending a few hours researching into how to use components, i can find nowhere that can explain why i cant use camelCase variable names to bind data. Can anyone point...
Tom Edwards
1

votes
2

answer
16

Views

Use HTTP Interceptor on condition set in $rootScope

I define an HTTP interceptor service using: fooModule.service('myHttpInterceptor', function ($q, $rootScope) { // ... }) I am able to push it in $httpProvider in the config block, and the interceptor works and is always enabled: .config(['$httpProvider', function($httpProvider) { $httpProvider.inter...
Hacène
0

votes
1

answer
20

Views

AngularJs password meter for bilingual application

I am using ng-password-meter for determining the password strength at the time of login. Now my project is bilingual (works in English and Swedish). I want the messages like 'strong' and 'weak' to show in Swedish also. Is there any way I can make manipulations to the ng-password-meter tool so that i...
Anonymous Rob
0

votes
0

answer
6

Views

How to react to a link loading the same URL in AngularJS?

I have a form on a page that is linked from my menu using a normal anchor tag. Now if that menu item is clicked again when I'm already on that page, I want to check for unsaved changes and either show a modal to ask if you really want to reload, if there are unsaved changes, or just reset the page,...
Dominik G
6

votes
4

answer
1.4k

Views

Invalid or corrupt jar file when trying to start selenium server from intelliJ

I am trying to start my selenium server from intelliJ and it is saying the file is corrupt. I use intelliJ to run my protractor tests, and I start the selenium server from the intelliJ terminal before I run them. For whatever reason it is saying my jar file for selenium-server-standalone is coming b...
P Jones
1

votes
2

answer
2.1k

Views

Changes in jQuery UI not reflected on Angular models

I have a form which is in a directive. It contains 2 select dropdowns (jQuery styled) and one jQuery UI slider, so it's all consistently themed. Dropdown 1 is populated at spawn, as simple as they come. Dropdown 2 gets populated when the value of Dropdown 1 changes. This happens because dropdown 1 h...
Swader
1

votes
3

answer
3.8k

Views

Negation in AngularJS expression.

I have one very noob question for AngularJS expressions. I want to check in expression (ngIf in this case) that something is undefined. Eg: data-ng-if='typeof obj.property == 'undefined'' How I can write expression to check this? I would be very grateful for any ideas and recommendations. Best r...
Georgi Naumov
0

votes
0

answer
17

Views

My angular can't get the value from html page

I have an angular function to call me rest service but it can't get the value from the html file. when i press submit the $scope.productForm is, although i still have value in my html page. Main.js $scope.products = []; $scope.productForm = { ID:1, Name:'', Description:'', URL:'' }; _refreshProductD...
Trung Đặng
0

votes
0

answer
38

Views

Javascript Pop-up alert - Days countdown Inside alert (7 - 0 days)

I have a pop-up alert in JS and HTML that has to popup if a ticket is older than 7 days. When the ticket does pop up, a user has another 7 days to respond to the ticket, so it accumulates to a total of 14 days. My issue is as follows: If the pop-up appears, it must show in the alert that a person h...
1

votes
1

answer
3.4k

Views

send multiple responses to client via nodejs

i am using nodejs and i want to send back multiple responses to client.And my code is below //addwork var agenda = require('../../schedules/job-schedule.js')(config.db); exports.addwork = function(req, res) { var work = new Work(req.body); work.user = req.user._id; var user=req.user; work.save(funct...
sruthi karan
1

votes
1

answer
1.3k

Views

The method and() is undefined for the type HttpSecurity

Im trying to follow this example that is basically a bit of code to actually invalidate de login on angular.js. I get 'The method and() is undefined for the type HttpSecurity' This is my part of my Code (line 89): @EnableWebMvcSecurity @Configuration @Order(SecurityProperties.ACCESS_OVERRIDE_ORDER)...
cristiandley
1

votes
2

answer
2.7k

Views

Javascript cannot parse JSON string

I was trying to parse this JSON string: {'query': 'my schedule today','type': 'timeline','title': 'Today events:','time':['2015-07-06\n20:30:00'],'summary':['Weekly meeting + Show & Tell (Hangout)'],'description':['Weekly Bullets (20 minutes): ']} This is a valid JSON (checked on jsonformatter.curio...
Hưng Cao Xuân
1

votes
2

answer
1.2k

Views

How to listen Android hardware back button in ionic

I try to listen android hardware back button,but it is no effect. main code: .run(['$ionicPlatform','$ionicHistory',function($ionicPlatform,$ionicHistory) { $ionicPlatform.ready(function() { if(window.cordova && window.cordova.plugins.Keyboard) { cordova.plugins.Keyboard.hideKeyboardAccessoryBar(tru...
woshikange
1

votes
1

answer
1k

Views

set object as selected in ngoptions

Im using ngOptions for select directive like im setting default in controller like $scope.users.jobTitle = $scope.ds.jobTitle[0]; ds is a json with array jobtitle: 'jobTitle':[ {'id':1,'value':'Service1'}, {'id':2,'value':'Service2'}, {'id':3,'value':'Service3'} ], now i'm saving and getting result(...
Arun
1

votes
3

answer
354

Views

Angular JS apply uppercase filter to boolean value?

I have an angular 1.4.12 binding: {{ mob.mobDataSettings[7].value | uppercase }} where the first part is a boolean from a json file which is of course either true or false. however, in the rendered HTML it is not being uppercased (i.e. TRUE), it's printing as true. Am I missing something obvious?
Steve
1

votes
3

answer
422

Views

align text to parent's parent

I have a list in an angular-app where each item can either contain a small image (as a div's background -> red) and some text or only text. li { display: flex; border: 1px solid black; width: 80%; margin-bottom: 5%; list-style: none; position: relative; } .text { text-align: center; width:...
user3479074
1

votes
3

answer
186

Views

ng-show is visible before hiding [duplicate]

This question already has an answer here: Angularjs - Hide content until DOM loaded 6 answers I am basically reviving this question, but with the slight difference that to me it happens upon page loading. //HTML Some very serious message here {{text}} //JS var myApp = angular.module('myApp', ['ngAn...
Camilo Terevinto
1

votes
1

answer
1.9k

Views

Angular 2 (CLI) Routing don't work (Cannot read property 'split' of undefined)

Why routing works only for first imported component after AppComponent (example code below: routing works only for 'PageNonFound')? Also, I noticed error after adding routing to my project Error Error in ./AppComponent class AppComponent - inline template:13:42 caused by: Cannot read property 'spl...
Evan Bor
0

votes
0

answer
21

Views

Refreshing Dropdown Arrays automatically

I have two dropdowns where I am passing two arrays from my angularjs file. One drop down has the names and the other drop down has the subjects. so when a name is selected from the first dropdown subjects related to that name is loaded to the second dropdown. Its working correctly. But if I again se...
tharindu
0

votes
2

answer
34

Views

Angularjs $http post method request getting cancel

I'm doing call from angularjs app to Rest web service. Most of the times request getting cancel. Sometimes first call it's getting cancel or sometimes second call getting cancel. And sometimes it's work fine. code is: $http({ method : 'POST', url : 'https://localhost:8080/myapp/api/j/save-file', dat...
Anil Jagtap
1

votes
2

answer
931

Views

What is the Underscore for in front of the arrow function (_=>) in the hero.service.ts Angular v5 Tour of Heroes Tutorial?

I have either a typescript or javascript syntax issue. Can someone tell me what _ => this.log... means? I am used to seeing a name the parameter being passed into the arrow function there. Does it simply mean 'no parameter'? Ref: https://angular.io/tutorial/toh-pt6#add-heroserviceupdatehero /** PUT:...
OpTech Marketing
1

votes
0

answer
16

Views

AngularJS unit testing Karma - unknown provider

I am trying to set up unit tests on our legacy AngularJS app. I am using the standard karma along with angular-mock to set up the tests cases. But I am getting issues with Unknown provider when I am trying to inject some services and factory. My karma.conf looks something like this (I have removed a...
Tushar Chutani
1

votes
1

answer
406

Views

Unable to check text field entry using Robot Framework

I am a newbie to Robot Framework, I am trying to check if my text field contains the correct entry. As you can see in the above screenshot, I have South Boston in one of my address fields. The html for this is: I have tried the following to check for the text South Boston. Method1: ${addressText}...
user1523236
1

votes
1

answer
45

Views

AngularJS Convert Text to HTML Tags

Okay so I am learning AngularJS, and one functionality is to allow the user to type HTML code into a textarea, this gets sent to the Controller and stored in a code variable. When the user presses the button to test the code, I want the text to be inserted into the HTML document. Currently all it do...
GoodDisplayName
1

votes
2

answer
139

Views

How to show placeholder when we hover on input type text

i want the placeholder to be visible when we hover on the textbox.
faraz
1

votes
2

answer
53

Views

How to pass data to angularjs foreach inside foreach

I have add my code and json which I want to loop. I have looped $scope.data using foreach loop and push to $scope.tempObj, its working fine. But when I try to loop $scope.data.policyDocumentContentCollection and push to $scope.tempObj.nested, its get console error 'Cannot read property 'push' of und...
Mahesh Sanjeewa
1

votes
3

answer
37

Views

AngularJs - Array.push() inside $http.get() produces a flawed array

I can't figure out what is wrong with my code. It seems to be a javascript issue. I'm loading a local txt file using $http.get (is there a different way?). I want to push this content into an array. For the sake of testing, I'm just pushing any string just to be sure that it doesn't have to do with...
Sergio
0

votes
0

answer
9

Views

How to route a new component in “Pages - Admin Dashboard Template” in AngularJS

I am trying to implement a new 'notification' component in the registration page and am currently getting an error in the inspect console stating: 'Uncaught Error: Template parse errors: 'app-notification' is not a known element:' I have tried placing the 'app-notification.../app-notification' in m...
Angello L.
1

votes
2

answer
40

Views

How to remove a scope of a component injected from a parent directive

I have a directive that dynamically adds child custom directives to the DOM based on some input. Everything works fine. But when the input changes and I re-render the DOM with a different set of child custom directives, the old scopes of the child custom directives are not deleted and hence, the eve...
user5095515
0

votes
0

answer
5

Views

Access an html file path in asset with router.navigate

I need to redirect the user to an html view when he does not have permission to access a module, the route is the following: localhost:4200/assets/pages/ access.html, I'm trying to do it with router.navigateByUrl ('/assets/pages /access.html '), since it is a different route to the root that I manag...
Natali Gamboa
0

votes
1

answer
35

Views

How to Convert Special character in URL format [duplicate]

This question already has an answer here: Encode URL in JavaScript? 14 answers How to enable CORS in AngularJs 8 answers My Api does not accept special character it thoroughgoing error as access-controller allow origin does not accept My File Name is Hello{#$^%.net}.pdf My Url Format Like This ht...
Afreen Ghouse
0

votes
0

answer
17

Views

What does this mean: items:Array<any>

Very new to Angular and Javascript. I have a homework for angular.js class. We have a code hint and need to create a simple form. In the code hint there is: export class AppComponent { items:Array constructor() { this.items = []; this.addItems(); } I dont understand what is ' items:Array' part and h...
ellie_k
1

votes
0

answer
223

Views

AngularJS - Validate when ng-model value not in Select options

I have a situation where the ng-model value may sometimes not be present in the ng-options list of a Select dropdown (ID of a user that is no longer with the company saved in a record, for example). AngularJS's behavior is that it adds an empty option to the dropdown, but does not mark it as Invali...
cheluto2
1

votes
0

answer
48

Views

how to set default view using angular-route-segment (not in index.html) angular js

In my MEAN application for nested views I am using angular-route-segment. Everything works fine with the nested views except for the initial default screen. my first page (index.html) contains header & footer with buttons connect & disconnect. This theme is common in all the pages. once I click conn...
Krishna Kiriti
1

votes
0

answer
369

Views

Is it possible to use Jasmine without Karma for testing Angular/Node based Nw.js apps?

I've read ton's of tutorials, but I must admit that this testing stuff is still very confusing to me. I have a Nw.js app which (of course) uses NodeJS and also Angular. I've installed the Jasmine test framework globally via npm and wrote an example test which starts with the following lines, and pla...
Bernd
1

votes
0

answer
34

Views

angularjs extension development kit

I have an angular application running, now some other team wants to add their module to my application and I don't want to change my existing application code. So, I am thinking of exposing some kind of xdk to that team so that they can build their own angular module add it to xdk and my application...
Bhushan Goel
1

votes
0

answer
90

Views

WebRTC adapter.js returns empty object

I am building a WebRTC app with the front-end emplyong adapter.js and AngularJS. A call to the function getUserMedia from adapter.js the success handler returns an empty object as the stream object. Below is a snippet of the code. index.html main.js $scope.constraints = { audio: true, video: true };...
tej-kweku

View additional questions