In AngularJS, a scope is an object that refers to the application model. It is an execution context for expressions.
0
votes
2answers
25 views
Angular $scope property gets overwritten when passed into function as an argument
I have an odd situation that I can't seem to figure out.
In Angular 1.4, I have a variable on the scope object used as a model to collect form data, $scope.videoModel. When a form is submitted, ...
0
votes
1answer
21 views
AngularJS rest call, followed by opening new window with body of response
I have a table dynamically populated, the last column being the result of a function like this:
function actionsHtml(data) {
$scope.link="/myRestTarget?restParam=" + data.value;
return '<a ...
-5
votes
1answer
33 views
How to upload image using AngularJS [on hold]
I am uploading image my code working fine when I use below HTML
<html>
<head></head>
<body>
<form action="http://www.example.com/customers/5832e319f1f1e5cc296e8802" method=...
0
votes
0answers
39 views
AngularJS - Not showing new values
I have one test01.html page. When I click on Next button of test01.html page they call one Java Service and that service return one key, name is changeList and I just display this key value into my ...
0
votes
2answers
23 views
Not able to change path using $location service even after using $scope.apply
I am wondering why I am not able to change my view using location service even after I use -
$scope.$appy() or $scope.apply;
I did research before posting my question. I got results of similar ...
0
votes
1answer
56 views
Is this good practice to use a single templateUrl for multiple states in Angular js? [closed]
I am using Angular frame work. I just want to know the way I am working is good or not ? If no what is the solution.
My requirement is if I login as admin I have one profile page
If I login as a ...
1
vote
2answers
655 views
How to pass parameters to controller in $mdToast.show function with angualr-material 1.0.1
I'm using angualr-material and want to pass a parameter to $mdToast.show() inside controller, I checked out there is a scope in the function but I don't know how to code it, I tried lots of ...
-1
votes
1answer
37 views
AngularJS Form and $scope not updating each other
I am trying to make a very minimalistic form in AngularJS (version 1).
I am trying to use ng-model and the $scope to update an object I've named fluff. Once a user clicks submit it should be used in ...
0
votes
1answer
17 views
Cannot add controller in angularjs which is defined in separate file
I am newbie to angular. Currently all of my controllers are defined in following controllers.js file on following patterns
function A($scope){.....}
function B($scope){.....}
function MainCtrl($http) ...
0
votes
2answers
32 views
how to upload file using Angularjs, multipart/form-data
i want to upload image using Angularjs anyone know how do this..REST API wants
Content-Type:multipart/form-data
www.abc.com/images/id
Request Body
{
// --Boundary_1_1626119499_1392398808202
...
0
votes
0answers
11 views
angularjs fullcalendar eventclick scope
i have a controller named CalendarDemoCtrl where i have the config for fullcalendar as shown below.
$scope.uiConfig = {
calendar: {
height: 600,
editable: false,
...
3
votes
1answer
2k views
Angularjs with redux
I have been reading some on Redux. Most of what I read is combining redux with react. I use Angularjs. Is there a good reason to use Redux vs just managing state within angularjs scope and allowing ...
3
votes
2answers
923 views
Change $scope value when a ng-click function is triggered
I tried to change a $scope variable in Angular JS's ng-click function. But Angular
does not seem to be able to do that.
Below is my code on my appController:
// appController.js
$scope email = "...
0
votes
1answer
31 views
how to iterate through an array and display it in $scope (angularjs)
Problem:
I am showing a list of documents in my application and one of the fields is a preview icon which shows a modal to display a pdf preview of the document. I am building a url to make it ...
1
vote
1answer
84 views
automatic download with hidden anchor tag not wokring on firefox
This code working fine on chrome but not in firefox. ANy idea what could be the issue?
var element = angular.element('<a/>');
element.attr({
href: 'data:attachment/csv;charset=utf-8,'...
0
votes
2answers
24 views
angularjs response data does not show in console
i have below code i but data not show in console log please help me i am new in angular.. AND how to show data in HTML
this.$http.get(properties.client+'/123')
.then(response => {
...
0
votes
2answers
46 views
Implement Authorization in AngularJS
I want to implement authorization in AngularJS. In my project which is some kind of social media, different roles or even same roles may see a view file differently.
For example imagine we have two ...
0
votes
0answers
12 views
uib-typeahead is not working
I have implement uib-typeahead for tons of time but i am clueless why it is not working
i want to get item name in the uib-typeahead
my code here is like this
$scope.suggestTestbySpeciality = ...
9
votes
1answer
11k views
What is the default for AngularJS directive scope?
What is the default scope value of an AngularJS directive?
Of course, it is not isolated scope. It is true or false.
I can't find any documentation on what it is.
0
votes
0answers
25 views
Weird behavior with this and $scope in controller method
Well, I am new to angular and my prior searches showed me that using 'this' is different from '$scope', inside a controller. Bearing that in mind, I decided to only use scope in my application, which ...
1
vote
2answers
20 views
Passing scope parameters to a Custom Directive as ng-src is being called repeatedly
My current implementation is shown below which is working but as the getImage method is inside expressions its being called repeatedly when any text change or data is entered on the page
HTML
...
0
votes
0answers
11 views
Angular Directive Transclusion Scope Issue
I am creating a custom directive as follows:
<directive-a attribute-a="customData" attribute-b="customKey">
<!--Transcluded Content-->
</directive-a>
The scenario is as follows:
...
1
vote
0answers
31 views
understand child scope angular
i try understand scope angular.I see the docs write
childScope.aString = 'child string'
The prototype chain is not consulted, and a new aString property is added to the childScope. This new property ...
0
votes
2answers
26 views
how to remove object from $scope. variable angularjs
How to remove one object from $scope.Profile.address object please help me see below code and image
<tr ng-repeat="x in Profile.addresses">
<td><input type="text" class="form-...
0
votes
3answers
42 views
AngularJS - Conditional attribute not working with variable?
Below is my Angular Controller
Angular JS
var multistage = angular.module("multistage", []);
multistage.controller('groupStanding', function($scope1) {
$scope1.grouplimit = 3;
$scope1....
0
votes
1answer
30 views
Array Object in a scope showing empty while reading in a child html page- angular JS
I have an array object in my angualr js file which while trying to console showing the results in js file. When I am trying to use the same object in a html file it is shown as empty.
Here is my code ...
0
votes
1answer
19 views
Directive callback executed after ng-if removes directive from scope
I have an angular directive on my page, within ng-if.
I have a service which exposes a function that receives a callback as a parameter. Let's call this function functionX.
When the ng-if expression ...
0
votes
1answer
28 views
Change nested views through ng-click in ui.router
I am trying to insert views inside view. But it is working only at the defined state but when I trying to change the view with the help of ngClick the state lost the path.
It is like
View 1
--...
0
votes
1answer
29 views
select value not selected in angularjs
I have this html markup:
<div ng-repeat="prop in props" style="margin-bottom: 10px;">
<label class="col-md-4 control-label">Property {{$index + 1}} ({{prop.AddressLine1}})</label&...
-1
votes
0answers
12 views
Upload image shows error “Cross-Origin Request Blocked” [duplicate]
When I use the logic below it causes following error:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading
the remote resource at
http://www.example.com/images/...
0
votes
2answers
31 views
angularjs ngmodel value with two values
I have this dropdown control
<div ng-repeat="prop in props" style="margin-bottom: 10px;">
<label class="col-md-4 control-label">Property {{$index + 1}} ({{prop.Value}})</label>
&...
2
votes
2answers
10k views
Is there any way concatenate the variable name with a string or it is basic programming Mistake
I am working on an AngularJs app. I have an array of HTML select tags where I am concatenating the ng-model name and the options list name with a variable. He re I have two list or arrays. the first ...
2
votes
2answers
25 views
Iterate over subscriber
I'm having a bit of a problem understanding the observer / subscriber model and looping through that return.
So I've got a cocktail component that grabs an array of cocktail objects.
The core of ...
33
votes
6answers
93k views
AngularJS - get element attributes values
How do you get an element attribute value?
e.g.
HTML element:
<button data-id="345" ng-click="doStuff($element.target)">Button</button>
JS:
function doStuff(item){
angular....
28
votes
1answer
11k views
AngularJS Directive element method binding - TypeError: Cannot use 'in' operator to search for 'functionName' in 1
This is the controller of the main template:
app.controller('OverviewCtrl', ['$scope', '$location', '$routeParams', 'websiteService', 'helperService', function($scope, $location, $routeParams, ...
1
vote
2answers
112 views
why ng-show not working correctly in angular?
I want to show a drop down when user click on icon .I use ng-show but it is not displaying the drop down menu option.
I make a icon ... .on click I try to open drop down menu using ng-show .but it ...
0
votes
1answer
26 views
Get bound object value of angular component from its controller
I have an angular component:
module.exports = {
bindings: {
vulnerability: '<',
},
controller: ['$scope', function($scope){
//want to get value of vulnerability from ...
10
votes
1answer
14k views
How to show images in img tag inside an ng-repeat while using Angular JS?
My problem:
I want to display a list of images, stored localy, using ng-repeat directive, but the images re not being displayed.
AngularJS version: 1.2.22
The code:
Directory Structure:
myapp/
|...
0
votes
2answers
21 views
Use a directive to display scope value and update scope
I have an array of vertex values that I loop over and display to the user.
The values are stored as a space delimited string, like this:
vrtx = ["10.3 20.3 10.5", "13.2 29.2 3.0", "16.3 2.3 20.2", ......
0
votes
0answers
10 views
Return App Control for angularjs from Express.js render to Jade page
I am starter for that subject and I could not any sample code for this problem.
Now I dont want showing any like this code
<script src="controller/fooCtrl.js"><\script>
in my renderer ...
0
votes
2answers
28 views
Angular dynamically change ng-repeat name
I have ng-repeat in my html. how I can add ng-repeat with dynamically changes name.
<div ng-repeat="category in categories"> //external repeat
<div ng-repeat="data in categoryData.{{...
1
vote
4answers
84 views
In Angular, how to get a form in $scope in controller?
Having these two files:
HTML:
<form name="registrationForm" ng-submit="registerUser()">
...
</form>
JS (inside the Angular controller):
$scope.registrationForm.confirmPassword.$...
23
votes
6answers
24k views
Get controller name from $scope
Is there a way to get the controller name from the current $scope in AngularJS?
0
votes
0answers
45 views
Angular.js - Redirection is cleaning my $scope(?)
I have an $ngController that is being used in two views. The first view has an <table> with ng-repeat that lists all my data from the db.
I get the selected object form the table by using get($...
8
votes
5answers
17k views
angularjs: $scope update when I change a select with jQuery
I'm using a jQuery plugin to 'customize' my selects.
This plugin fires the change event of the original select when some option is selected.
The problem is that my scope doesn't change.
Here you ...
0
votes
0answers
32 views
Is there a way to alias scope variable for a html node?
I Have a directive myDirective which has a template and transcended html (transclude: true)
myDirective template has a repeater ng-repeat="item in transformSourceData"and transcluded template uses ...
-2
votes
0answers
20 views
Data is being passed to the page but isn't showing (Angular JS)
I can't seem to get my form data to show on my html page after submitting the form. The data seems to be passing, as I see it in my console.log as well as the unique ID gets passed in the url. What is ...
0
votes
2answers
44 views
Using scope which can be shared between all components in Angular
I have simple controller with one method:
app.controller('MyApp', function($scope) {
$scope.myMethod() {...}
}
I have also many components for input fields (for example for text input, number ...
0
votes
1answer
43 views
AngularJS ng-repeat issue and add row dynamically on button click
I want to create a simple form with some nested data. When I click the addSite() function, I want to create a new Site item and append it to my $scope.info.
I cannot create more than one form and the ...
17
votes
3answers
15k views
Setting focus on an input field after ng-show
Is it possible set the focus of an input field via a controller once data has loaded (via $resource in this case)?
The input is hidden via ng-show until the data is returned from the API but I can't ...