new

Stack Overflow for Teams

A private, secure home for your team's questions and answers.

Learn more
0
votes
0answers
21 views

Angular js ng-Options adding extra option as default with dynamic model name inside ng-repeat [duplicate]

I have been troubling to fix this, i just wanted my dropdown to use my supplied value as selected. My HTML: <select ng-init="status[lot.mid]='{{lot.status}}'" ng-model="status[lot.mid]" ng-...
0
votes
1answer
42 views

Angularjs 1.4 - Two ways binding - Input text changed but scope does not?

I have a very weird problem with AngularJS 1.4 (TypeScript). The problem is in the controller I have a variable and this value can be viewed in an input text box. However, when I edit the value in ...
0
votes
2answers
29 views

Not able to access angular directive's isolated scope

First Directive: app.directive("myDirectiveOne", function($rootScope){ return { templateUrl : "/custom-one-html.html", restrict: "AE", replace:true, scope: { ...
0
votes
0answers
18 views

Unable to bind controller $scope to directive modal [duplicate]

I have created a directive of bootstrap modal. I have binded $scope.reaso,$scope.modalHeader ,$scope.activity, $scope.myLeftButton from parent controll to the directive.I am changing the $scope.reason ...
-1
votes
0answers
13 views

Not able to create new folder in angular through terminal command

I want to create a new component (folder) in Angular 2 through Terminal I used command ng g c foldername but command is not found
0
votes
0answers
29 views

How to call the function when api is called in AngularJs?

I want to minimalize my code, so how can I call the function by sending the date and time while api is called ? app.controller("attCtrl", ['$scope', '$filter', '$http', function ($scope, $filter, $...
0
votes
2answers
38 views

Cannot read property 'length' of undefined in Angularjs 1.6.6

I have to dropdown lists and want to populate the second list on the basis of selected value in the first list. I encountered a problem in populating the first list. I use getCurrentSessionCourses() ...
0
votes
1answer
31 views

Cannot create property 'subjects' on number '1' using AngularJs

I want to select multiple subjects across one course but can't do so I have two dropdown lists one for course selection and one for subjects selection. For multiple selection of the subjects I use ...
1
vote
2answers
37 views

Setup a attribute directive via another attribute directive is causing double bindings

Background: I want to to use ease up the usage of the <uib-tooltip> directive in my project to mainly have translated texts and to set further options for tooltips. For translation, I use ...
1
vote
0answers
34 views

How to manuplate path in JSON using AngularJS?

I want to create a new file inside a file. How can I achieve that? Below I'm getting the files and their paths and I can access them <div ng-repeat="t in main.path" style="padding:10px; float:...
0
votes
1answer
41 views

Angular 1.x - retrieve directive value from controller and assign it back to parent scope

I'm unable to get a variable value from directive to use that back in a controller. I do not have to bind the value to a view. All I need is to set 'cleanInputValue' from directive to $scope.keywords ...
-1
votes
0answers
18 views

Showing Data only after reload

I've been using angularjs in my project. In that, I'm saving the user details including username in session storage once after login is finished, I want to show username in the homescreen navbar.I ...
1
vote
1answer
68 views

What's the difference between < and @ scope isolation in angularJS?

My Rails app has different organization with their profile page with their own inventory stats table. Written below is the part of app/views/organization/show.html.erb <div ng-app="cc-app" class="...
0
votes
1answer
33 views

How can create validation for single control's value required from multiple control in angularjs(1.*.*)

i.e, I have four text boxes if I enter a value in any text box out of all text box, it should be allowed to submit otherwise throw an error,"Value is Required", It is possible using angularjs ...
0
votes
0answers
27 views

Angularjs: undefined isolated scope property when using controllerAs in custom directive [duplicate]

I am studying AngularJs for some legacy project. This seem to be a trivial example but I'm absolutely stuck. I tried to rewrite my custom directive code to use controllerAs and it does not work any ...
1
vote
0answers
77 views

AngularJS multi screen validation on last step

I have an angularJS application. I have implemented a generic workflow using $routeProvider, templateUrl & Controllers. Each step(screen) is verified when user click on next button and moves to ...
0
votes
1answer
15 views

How to call variable from get method to post method? [duplicate]

I want to call v = "'"+u+"'" value into post method and i declared them as global variable. I'm not able to console those values outside get method. It's throwing me error. How to fix this ? scope....
0
votes
1answer
32 views

ng-file-upload is not working properly with each element in ng-repeat

I am trying to upload multiple files for each object in ng-repeat in an array.But when I try to upload files for 2nd/3rd object(other than the first element) in the Array, all the files getting ...
0
votes
1answer
17 views

getting control scope values changes in injected directive?

i am having my own directive called myDir. I want to import this into my angular sample and i want to watch my sample side values in my myDir. <div ng-controller="MyCtrl"> <my-dir ...
0
votes
1answer
51 views

Update array object after custom filter

I have a custom filter that I'm using to aggregate a $scope object that is being used in an ng-repeat block. my code looks like this: $scope.myobj = isSelected ? $filter('customFilter')($scope....
0
votes
2answers
105 views

Angularjs How to get value of input[text] in controller

I want to get value of input[text] in my controller when data is changed as this source code: (function () { 'use strict'; var app = angular.module('app', ['ngMaterial']); app.controller('...
1
vote
1answer
45 views

AngularJS Variable inside scope or custom directive : related to ng-messages-include

I am learning AngularJS, came across one scenario and not sure what is the best approach. Below is the scenario. The html pages are running on a server https://example.com/com/server/ and can have ...
0
votes
1answer
59 views

How to display multiple records with same id on table with Angular?

I have a json response with following structure; https://jsonplaceholder.typicode.com/posts I need to display the table on a attached image structure. What I have done is below but it is displaying ...
0
votes
3answers
158 views

AngularJs pass model value + model name to function in controller

$scope.populateMap=[{name: "ABC", code: "123"}, {name: "XYZ", code: "345"}] //Want to send model name + value of model Currently sending ngObject.MainObj.specificFormatObj HTML <select ng-...
0
votes
2answers
39 views

How to use ng-if in options in angularjs?

I want to change my state to on if status == 1 and state to off if status == 0. I'm able to do that on the table in this way <td> <span ng-if="configuration.rule.onSuccess == 1"> ...
1
vote
0answers
27 views

AngularJS scope is passed to directive after directive's factory function exits [duplicate]

I'm trying to upgrade an AngularJS template we're using to its latest version. Now, this template upgraded to AngularJS 1.6.9. But now, after i've upgraded, i'm experiencing a problem that the vm ...
3
votes
1answer
52 views

Get last inner ng-repat index

<div ng-repeat="post in vm.post track by $index"> <button ng-click="vm.remove(post,$index)"></button> <div ng-repeat="comment in post.cmt track by comment._id"&...
2
votes
0answers
49 views

ng-repeat done event not firing on tab change but works fine on refresh

on-ng-repeat-done directive is not working when I am switching tabs or performing any operation(Page not refreshing). But it works fine when I refresh page. I have below sample where we are using ...
0
votes
0answers
13 views

Header scope and relative controller not re-executed after location search

I am currently trying to solve if there is a best practice to manage the situation on subject. I have some info (like page label, menu items) stored in the scope of the Header component, and when in ...
2
votes
1answer
23 views

How to get model value from textbox which is binded from dropdown without changing the model value of dropdown

In my project I have a drop down and a text box in a Angular html page. From drop down I select a option , after selecting that option it got binded to textbox. Later I need to change the value of ...
2
votes
1answer
37 views

Why isn't my dynamically created element not showing up?

OK So I created a chat widget that isn't hardcoded instead it it is created by a service for example: $chatWidget.setParent(parent).setUser(user).setMessages(messages).build(); Here is the build ...
0
votes
1answer
40 views

How to use built-in services from angularjs directives?

I'm able to get some ID from URL using angularjs built-in $location service. Now, I need to call a service with that ID when the page loads, and then response needs to be rendered in some way. I'm ...
0
votes
1answer
65 views

Directive to wrap html element in hyperlink

I'd like to write own directive which can wrap any html element in hyperlink using the passed parameter, so for example: <button myDirective="parameter">...</button> will have following ...
0
votes
1answer
31 views

AngularJS setting directive scope variables from a service

OK so I am trying to make a simple chat widget directive and I want it to be dynamically created wherever I want it on my app ie I do not want a hard coded solution. So I want the directive to be ...
1
vote
1answer
46 views

Angular JS two-way bound variable does not update parent scope

My understanding of AngularJS directives is pretty poor. What I've been trying to do is use this mediaLibrary directive as a popup, so I can add media library items to a portfolio item (like images to ...
0
votes
0answers
35 views

angular directive event listener missing events

I have a weird issue where my directive works, but on some keys, scope.watch and element.bind don't fire! if i press 1.2222222222 my directive will limit my input to 1.22, however in this specific ...
0
votes
1answer
16 views

Accessing variables set in the controller from the directive

I am trying to avoid the use of $scope in my angular controller (as suggested in a best practices tutorial). In the controller, I'm setting testVariable. In the directive, I'm returning the template, ...
0
votes
0answers
40 views

TypeError: linkNode is undefined

I'm working on a SPA that is written largely with Angular JS 1.6. not using routes. Here we are displaying HTML pages using directives by setting a scope variable as different URLS. Here I am getting ...
0
votes
3answers
32 views

AngularJs $scope parameter name

I'm quite new to AngularJs. In initial chapters itself I see $scope being used, like inside a controller. <script> var app = angular.module('app1', []); app.controller('ctrl1', function($scope) ...
0
votes
1answer
272 views

TypeError: jit_nodeValue_4(…).$any is not a function in angular 5

I have tried almost everything avalible. But I am not able to find any solution
0
votes
0answers
20 views

How to include an angular-ui/ui-bootstrap directive within my directive

Using AngularJS ~1.5, I'd like the outer scope (my directive) to be available to the inner directive. Assume a simple template like: <h1>{{info.title}}</h1> <uib-something ngModel="...
1
vote
0answers
35 views

AngularJS - When exactly is directive scope data first bound to the DOM?

I have a general understanding of how AngularJS processes directives however I'm unsure of exactly when data for scope properties is being bound to a corresponding expression in the directive's HTML ...
0
votes
1answer
42 views

angularjs how to use service $scope variable in another function

In my angularjs html file, i am reading a file data using a service and showing data in directive. It is working fine in displaying treeview. I have put a ng-click "ShowDetailsFunc()" for each item ...
0
votes
0answers
51 views

Always getting first item from list though selecting third item using ng-repeat filter in mobile view

I have a drop down with search filter, created it using ng-repeat filter. Its working fine in desktop view but same code is behaving strange in mobile view/mobile device. In mobile device, I have a ...
-1
votes
1answer
28 views

on ng-click all three values in my input box are being triggered which have different button for different input box (new to angularjs)

I have three input boxes, on ng-click set d1, only the value in first input box should be sent and the value should replace the value of "calibration.result.calibration.d1" with "calib.calib.d1". but ...
0
votes
1answer
20 views

Isolated scope on template appended to element parent

I have the following directive: app.directive("mydirective", ['$compile', function($compile) { function link(scope, element, attrs, ctrl, $transclude) { var actionBtnHTML = `<button ...
1
vote
1answer
63 views

How to get selected values from custom drop-down using angularJS

actually I have been implemented one custom drop-down using <ul> & <li> elements in my application. And right now I am able to select dropdown values by using mouse click but as part ...
0
votes
0answers
37 views

Why the scope variable data is not passing via directive in AngularJS?

I have a html page <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="dependency/jquery/jquery-2.1.4.min.js">&...
0
votes
1answer
88 views

Failed to instantiate module, Even when proper module defined

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <script src="../angular/angular-1.6.7/angular.js"/> <script src="../angular/angular-1.6.7/...
0
votes
1answer
139 views

Passing dynamic url value to angular js controller

I want to pass url parameter $id is dynamic value to Angularjs controller My Angularjs: $http.get('/todos/show/'+$id).success(function(data) { $scope.customers = data; }); My Route in laravel ...