In AngularJS, a scope is an object that refers to the application model. It is an execution context for expressions.
0
votes
0answers
32 views
AngularJS not updating view
I'm quite new to Angular, and I feel that the more nesting there needs to be, the more complex the code. I feel that I'm missing some fundamentals here.
Problem: In the chapter.html I see everything ...
0
votes
1answer
19 views
Expose directive methods to $scope
I'm having some trouble with one of my Form directives :/ I want a directive that can communicate with others directives that i have in a page, and this directive would communicate with the ...
0
votes
0answers
18 views
directive post link function - focus on element once it's visible
I have the following directive to allow focusing on an element:
angular.module('app').directive('focusOn', ['$timeout', function ($timeout){
return {
scope: {
focusOn: ...
0
votes
0answers
20 views
how sorting work in angular ascending and descending order?
could you please tell me how to sort column in ascending and descending order when user click on header of each column .I have list in which header is placed on top .I want to sort my column using "^" ...
-1
votes
0answers
28 views
Apply function Angular doesn't work with array
I update an array outside application Angular with apply() function. I notice that for a simple variable it works, but for array the array didn't update. I don't understand why ?
$scope.altLabelFr = ...
0
votes
1answer
38 views
Refresh array items of scope in angular.js
I have an array with x items. I need to copy this items and add a few more, but when I show the items in the ng-repeat I copy the firsts again.
How can I delete the items and put the new in real ...
0
votes
0answers
15 views
Generate pdf using stream in Angular
I am trying to generate pdf and display inside any Div, I am getting binary data from server but when I try to convert that stream it says failed to load pdf.
I googled it and saw response of many ...
0
votes
3answers
36 views
AngularJS ng-show with $scope variable not working
guys. I'm doing a login page.
When users haven't logged in, the page will show greetings and login button.
When users logged in, the greeting and login button will disappear and logout button will ...
0
votes
1answer
49 views
AngularJS - httpget multiple times for same form
I am making an application. I have a form where the user can type in a product. I get the price with an angularjs service. I inject it in. RateInfoService.
So if I type in "Milk" it will say in the ...
0
votes
0answers
30 views
Passing a method from directive to factory
I'm trying to pass a method that is defined in the controller, via a directive to a factory. I seem not to be able to fully understand scoping or the best way to do this.
HTML:
<div ...
0
votes
0answers
21 views
how to access dynamic key and value fields while use select option with ng-repeat using angularjs directive
I have mention code and jsfiddle link below. This directive for dynamic select2 drop
down element option. Here {{tag.optionKey}} is not get dynamically. for example, if i gave option-key="type", ...
0
votes
2answers
34 views
accessing directive variable from parent's parent controller
I have a case using kendo editor.
First controller
app.controller('FirstController', ['$scope', function($scope) {
$scope.Html = "<div> Hello World</div>";
}
2nd Controller For ...
0
votes
0answers
18 views
how to set key field as dynamic in select2 dropdown using angular directive
i want to run dynamic data through ng-repeat and set dynamic key
values, like below,
in directive scope:
K
optionKey : '@',
optionValue : '@'
in my template:
...
0
votes
2answers
23 views
AngularJS directive doesn't set 2nd level of scope object
I'm using a directive to read json data from a <script> element, this works fine as long as my ng-scope is a first level property like data. For some reason I'm not getting the data in 2nd or ...
0
votes
2answers
19 views
Can scope properties be passed by reference in AngularJS?
Would the below code work as intended in an AngularJS controller?
updateProperty($scope.property1);
var updateProperty=function(property){
property+=1;
/* Will the above line change ...
0
votes
1answer
28 views
Using $scope and 'this' in the controller with Angular UI Router
Regarding $scope and this when using ui-router,
If I am using the controllerAs syntax, ie:
.config(['$stateProvider', function($stateProvider) {
$stateProvider
.state('app.login', {
...
0
votes
1answer
37 views
Refresh html table data at regular interval using Angularjs
I'm trying to refresh the html table data for every ten seconds by invoking GetTicketDetails method using $interval service, but my view is not reflecting the changes. Below is my Java Script Code ...
0
votes
1answer
19 views
Shared scope of a directive when 'controller as' syntax is used
Here is a simple example of using directives (adapted from the official guide)
- JSFiddle
<div ng-controller="Controller">
<my-customer></my-customer>
</div>
...
1
vote
1answer
28 views
“this” vs. $scope in angular
I know similar questions have been asked, and I have read the answers, but I still don't get this, so any help will be appreciated.
The code below works. However, if I use $scope instead of this ...
0
votes
0answers
36 views
Can't access scope data in Angularjs
I am currently working on angular app and bumped into a problem. The problem is when I'm getting the data form backend through factory into controller, eventhrough I apply this data to scope I can't ...
1
vote
2answers
31 views
Call a function from a directive to the controller
I am trying to implement a simple comment writing from client to server using angular.
Here is the HTML for the comment form:
<form id="commentsForm" name="commentsForm" ...
0
votes
1answer
17 views
Passing scope value through function call to controller not working
I've a function which deletes individual items from the array, based on the value i pass. Here's the flow:- I call a function on click of a button deleteImage('{{image}}') and in the controller i've ...
-3
votes
1answer
37 views
how to install grunt sass in angular js?
I am trying to use grunt in my first angular project .I am trying to use sass in my project .I follow all steps of this link
...
0
votes
0answers
21 views
TypeError: Cannot read property 'hash' of undefined
I am facing an error while i am trying to call the following angularjs method with id and $event as parameter
$scope.gotoLink = function(id, $event) {
$event.preventDefault();
...
1
vote
0answers
48 views
AngularJs: Uncaught ReferenceError: $scope is not defined in debugger mode [duplicate]
I have the following code:
Html
<div ng-controller="MyCtrl">
{{message}}!
<button ng-click="changeMessage()">change Message</button>
</div>
AngularJs
var myApp = ...
0
votes
1answer
21 views
smart-table - custom pagination
I am using smart-table plugin for pagination.
My requirement is- i am fetching 100 records from database while loading and records per page is 10.
So, number of pages would be 10 in pagination.
Now, ...
0
votes
0answers
14 views
ngImgCrop upload preview not showing any pictures in modal
I'm currently working with ngImgCrop to provide an upload preview (and square crop) of profile pictures.
Unfortunately neither the image preview nor the crop are being displayed.
'use strict';
...
0
votes
1answer
17 views
Angular error response interceptor: how to pass response object to template?
This is the factory I can include in any controller so they can listen for response errors:
app.factory('AuthInterceptor', function ($q, $injector) {
return {
responseError: function ...
0
votes
3answers
26 views
$scope variable not set from Factory
I'm new to Angular
I'm trying to pass some data into a controller from a factory method. I can see the the data when I log the Factory variable. I try to pass the data to a $scope variable ...
0
votes
1answer
20 views
Angular two way data-binding dosn´t update table in different route
I have an angular app, and an index.html with an ng-view that renders to different views partials/persons.html and partials/newPerson.html.
when i add a new person to the $scope.persons in my ...
0
votes
0answers
24 views
How to have multiple containers with same directives to have separate scopes
Here is the HTML code of what I am trying to achieve :
<filter-container>
<filter name="vm.dropdownFilters[0].title" filter-options="vm.dropdownFilters[0]" ...
0
votes
1answer
26 views
Getting out values from an array using angular.foreach in $scope
I have a dynamically changing array based on another code and I'm trying to retrieve specific data from the same.
Here is a sample of one dynamically generated array under $scope.filtereditem:
[{
...
1
vote
2answers
24 views
Switching views within the same controller whilst retaining scope data
I have a page of data that can be viewed as a list or as markers on a map. It also has filtering in the sidebar. I currently have this structured as separate map and list pages but I want to merge ...
2
votes
1answer
33 views
angular ng-repeat dosen't wait for scope
html
<div ng-repeat="item in timesheets">{{item.week}}</div>
script
.controller('TimesheetMainCtrl', function ($rootScope, $scope, $window) {
dpd.timesheetold.get(function ...
0
votes
0answers
46 views
How to test vm.variable - function(){..} unit testing with jasmine?
I am using karma- jasmine framework to test my angular application. I'm facing a problem in calling the functions of the controller or service form my test-spec. I tried using controller. as well as ...
2
votes
3answers
32 views
Difference between child and isolated scopes in directives
I was trying to understand scopes in AngularJS directives. From what I gather there are three types:
scope inherited from parent controller
child scope (scope: true)
isolated scope (scope: {})
I ...
0
votes
1answer
45 views
calling a function from controller inside other controller
I am display a modal where if the user click on delete button I want to call delete() from controller A inside controller B
I am refactoring the Todo App example code at AngularJS website (based on ...
0
votes
0answers
12 views
Multiple parameters angular promise returns undefined
I've been trying to follow this passing of multiple of parameters here
But got errors. The $promise returns undefined.
app.factory('ListUserResource', ListUserResource);
ListUserResource.$inject = ...
0
votes
1answer
37 views
Bind and scope ng-repeat json elements
I've made a food take-out app and I'm trying to send the result using mandrill email. I'm able to use input form and send emails, however, I'm not able to bind and scope the filtered json ng-repeat ...
0
votes
1answer
13 views
Integrating controller and directive for input box AngularJS
I am new to AngularJS
I have two programs written. First is auto appending input text box
<div ng-app="myApp" ng-controller="MyCtrl">
[<span ng-repeat="input in ...
0
votes
1answer
25 views
how to make modal confirmation for delete action with symfony2 and angularjs
This is my controller Symfony :
$em = $this->getDoctrine()->getManager();
$advert = $em->getRepository('OCPlatformBundle:Advert')->find($id);
if ($advert == null) {
throw ...
0
votes
0answers
11 views
AngularJS with Ionic 1) $scope - HTML Element Connection 2) Reading html-attribute
I'm relatively new to AJS
I have to save a SQL Statement inside an html input for easy maintanance but cant seem to access it properly like the examples I've seen everyhwere
My routeconfiguration is ...
0
votes
1answer
28 views
How to turn an array of objects into an array of arrays in Angular?
Original array of objects:
$scope.items = [
{
'name': 'Apple',
'value': 10,
'color': 'green',
'size': 'medium'
},
{
'name': 'Kiwi',
...
0
votes
2answers
16 views
Angularjs Filter : model in child and flilter in parent in angularjs
HTML
<div ng-app="myApp" ng-controller="mainCtrl">
<div ng-controller="secondCtrl">
<p>Filtering input:</p>
<p><input type="text" ...
0
votes
1answer
15 views
need to postpone watch on input model till mouse leave or tab enter in Angularjs application
I am using ag-grid with cell renderer as input box, as I am facing problem to fire event on ng-blur in ag-grid, I have tried with $watch on ng-model of the input box. Now the event is firing whenever ...
0
votes
2answers
45 views
Angular scoping weirdness in directives
I have a custom directive that looks like this:
<menu-section sections="menu.sections" addons="addons"
options="options" menu="menu.id"></menu-section>
I've defined it here like ...
0
votes
0answers
22 views
How to prevent $scope.$destroy?
I want to prevent $scope.$destroy event in my nested controller in my page. I see the event object in callback function has method preventDefault, but it's not working as I expect.
...
-1
votes
1answer
26 views
Angular directive without scope defined [closed]
I would like to know what it mean when directive definition have no scope:, and also what would be equivalent if I where to add scope:.
Like this example:
.directive('myCustomer', function() {
...
0
votes
1answer
17 views
pass $scope value of a constructor function to directive
Here i want to pass $scope.myData of app.js to the directive mcsaForm and use the object attributes in myTemplate.html. My code is working properly except the approach which i mentioned above.
...
0
votes
1answer
17 views
AngularJS ES6 ui-grid directive scope, ng-click dont work
I have a chain directive with angularJS and ES6 and want to use ui-grid.
The grid is shown with the correct columns and data, thats fine.
But ng-click don´t work in the cellTemplate. Nothing happens.
...