In AngularJS, a scope is an object that refers to the application model. It is an execution context for expressions.
0
votes
1answer
27 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
1answer
27 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&...
0
votes
0answers
10 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
30 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>
&...
0
votes
1answer
21 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
...
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 ...
0
votes
0answers
14 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
--Sub ...
2
votes
2answers
23 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
92k 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
109 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
22 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
20 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
8 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
26 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
81 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
42 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
41 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
42 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 ...
2
votes
1answer
17 views
Assign local storage value to $scope
I'm trying to assign local storage value to $scope variable and use that $scope variable in ng-model to initialize dropdowns. im trying the below code and it is not working.
Here is the plunker: ...
0
votes
2answers
27 views
select by default value for dropdown not working by using 'track by' in angualrjs
I am using track by to avoid strange values ::string that are appending to value but when i select by default dropdown , dropdown is not getting selected..
this is my plunker
Example Plunker
0
votes
0answers
11 views
How to avoid compile errors in Angular when service functions are used inside the view?
I have Access service functions such as Identity.role() inside the view of 'product' state in order to switch HTML depending on user role. When the user logs out, session kept in $localStorage is ...
0
votes
2answers
31 views
AngularJS: How do I get a variable from a $http. to another controller?
I have been working on an angularjs webapp using WS of moodle to get information, I have a little problem with variables, I would like to get a variable from a $http. and I saw that you can use ...
5
votes
2answers
3k views
Angular-grid when using $http to load json data
I am using ag-grid plugin in a project. I get json data using $http service. But the grid shows blank in web page. But when json data is applied directly, grid works. I think this is probably due to ...
0
votes
0answers
29 views
Angular (1.5) $compile with multiple scopes
When using controllerAs in Angular 1.5, you can refer to multiple scopes from the same chunk of HTML, for example:
<div ng-repeat="activity in landing.activities">
<draggable-action-item ...
0
votes
1answer
33 views
Angularjs push array to scope
I have problems to push an array to scope and empty the array after that.
I fire up the function ng-click="addInput() to add a new form to the Array $scope.info.sites = []; wich contains an another ...
0
votes
4answers
128 views
console.log for $scope in angular js
Why I'm not able to console output $scope values ? I'm trying to extract user assigned values from the pages and retrieve in controller. Eventually i would like to pass this to service so multiple ...
0
votes
0answers
20 views
Url change event when absolute url is change in angular
I am having url for
page1 : Application/Controller1/Action1
I redirect to page1 to :
page2 : Application/Controller1/Action1/#/SubAction1/40
Page 1 is in mvc.
Page 2 is in angular.
If i redirect ...
0
votes
2answers
32 views
How to bind a checkbox list using Angular and get all selected value from the checkbox using ng-reapet method
How to bind a checkbox list using AngularJS and get all selected value from the checkbox using ng-reapet method?
I am try to get the value of the selected check box in the angular controller.
View
&...
0
votes
2answers
52 views
how to save textbox values in scope variable angularjs
i want store textbox value in my Values variable but its not save i don't know why anyone help me please??? i am new in angularjs that's why i am here please help me i want store values from ...
0
votes
1answer
34 views
add unshift function not working in angularjs
Can I know why that my add function is not working after I create edit function. Supposedly, user will enter the data and click on plus button icon to add the data into the table. The data will be add ...
1
vote
3answers
43 views
0
votes
1answer
21 views
Access ng-model value in external js
I need to save ng-model value in string format and use it in an external js.Below is the code. I'm not able to save it in a string format.
<!DOCTYPE html>
<html>
<head>
<link ...
0
votes
1answer
25 views
how to get last index of array ng-repeat
how to get array last index + 1 using ng-repeat directive ??
dynamic Profile.addresses[2].site_name
<tr ng-repeat="lines in array">
<td>
<input type="text" class="form-control" ...
0
votes
1answer
51 views
Update record into current json array angularjs
I want to update new row data in my current Address Array but its not updating,
See below images, I am new in Angular, add other object of array see last image
<tbody class="gradeX">
...
0
votes
1answer
53 views
Is this good practice to use a single templateUrl for multiple routes in Angular js? [closed]
I am using Angular frame work
My requirement is if I login as admin I have one profile page
If I login as a staff the ten I have same profile(same html) but differnt header ,s idemenu, footer is ...
0
votes
1answer
33 views
Angular Material datepicker filter specific date
Can someone please explain how to apply a custom date as a filter using Angular Material without causing everyweek on that day to be selectable?
I've followed the documentation and can get it to work ...
1
vote
2answers
55 views
Scope not updating UI inside the success function of http.get
I want to integrate the same high chart as in this link with Restful API using the $http.get, it doesn't work because of the $scope.pieData is in the success function:
app.directive('hcPieChart', ...
0
votes
1answer
28 views
$scope variable doesnot bind with view after getting updated
I have a $scope variable isAuth that is a boolean which will be true when user signs in. And I use this variable to show a footer using ng-hide. I have a route definition with $routeProvider service ...
-2
votes
1answer
32 views
how to add new row data in current json array angularjs
i have added new row but i want update new row data also in database but there is no updated data how to get new row data also add address json array
<tr ng-repeat="x in Profile.addresses"&...
0
votes
4answers
38 views
Cant access scope variable in view
I'm new in angular.I cant access the scope variable in view.
Controller
$scope.getData = function (val) {
alert(val)
$scope.value= val;
}
view
<pre>{{value}}</pre&...
0
votes
3answers
56 views
unable to access scope value
I have a code like this in html:
<div ng-if="item.shareText">
<textarea></textarea>
<div>
<select ng-model="shareOptions">
<option value="PUBLIC" ...
0
votes
0answers
32 views
Inline edit function not working using angularjs
I really hope that you can help me. I have problem where i want to make CRUD operation. I successfully create add and delete operation but I can't create for edit function. My vision is to have a ...
0
votes
3answers
42 views
how to store Specific Column in scope variable Angularjs
I have $scope.Profile variable, in this variable below image data are store but i don't want yellow highlighted column , how to remove these columns from $scope.Profile variable, i want only full_name,...