In AngularJS, a scope is an object that refers to the application model. It is an execution context for expressions.
5
votes
1answer
30 views
Angular-ui: Is any modal opened?
I'm want to launch a code if any modal opens. Commonly I'm want something like:
$scope.$watch(function () {
return $modal.isOpenState;
}, function (val) {
//my ...
1
vote
1answer
15 views
Can onbeforeunload event be watch by $watch in angular js?
I am a newbie of angularjs and now I am stack on catching event of onbeforeunload event. I would like to show to some response to user when they leave the page. And I would like to watch ...
1
vote
0answers
19 views
AngularJS Material using $mdDialog in a directive linking function
I am trying to put an Angular Material dialog in a directive's linking function. Conceptually, I'm not seeing why this would not be possible. As per the docs, the $mdDialog.show is on a scope and ...
-1
votes
0answers
7 views
Custom meta description in AngularJS
I want to change meta description by URL.
Controller's structure is:
$scope.showMoreDemoCat = function (callback) {
TimeCategoryService.getTimeCategoryPosts(timeCategoryTag, "DemoCat", ...
0
votes
3answers
21 views
AngularJS nav active class won't show
I'm Quite new to AngularJS and I try to develop a nav bar, which changes the activeclass. So I tried to make a function in my controller to define the active class.
My html code of the nav:
The ...
1
vote
1answer
26 views
Accessing parent Controllers scope within a directive that uses ControllerAs and scope:true
I'm trying to use ControllerAs in a directive with no $scope injection, using this instead, and I'm struggling when scope:true
When I use an isolated scope everything works fine because I can use ...
0
votes
1answer
21 views
how to get event when user scroll to top in angular js?
could you please tell me how to get event when user scroll to top .Actually I am using ng-repeat in my example .I want to get event when user scroll to bottom and scroll to top .I have one div in ...
0
votes
1answer
20 views
how to make slide toggle function in angular js
I am trying to make slide toggle function in angular .but did not get make perfect as we do in jquery see example .Panel come in slide down and hide in slide up .can we make in angular js
Demo
...
0
votes
0answers
12 views
Access scope function from dynamic HTML inside a directive
When the user clicks the trash icon, it open a tooltip next to it that asks for confirmation. I would like the confirmation link in the tooltip to trigger the scope function $scope.deleteFont()
The ...
0
votes
1answer
22 views
custom directive required params
can we create a custom directive set as an element with required parameters , so that if these params are not provided by who ever would like to use it... then the directive must not work ???
**JS:**
...
2
votes
3answers
42 views
How to show a hidden <i> tag when clicked on an item
HTML
<li ng-class="{class : classVar==='Marketing' }" ng-click="changeClass('Marketing')">
<i class="fa fa-pencil" style="visibility:hidden;"></i>
...
2
votes
2answers
43 views
How to set background colour when click on an item?
HTML
<ul class="ul_nav">
<li ng-class="class" ng-click="changeClass()">Marketing</li>
<li ng-class="class" ng-click="changeClass()">Sells Team Nestle</li>
...
0
votes
0answers
24 views
angularJS update table model on form submit
I'm new to angular, currently having a problem with updating a table data on form submit. This is my view:
<div class="container-fluid">
<div class="row">
<div ...
0
votes
1answer
40 views
how to display sorted only 25 element in infinite scroll?
I am using infinite scroll in my demo ,In which I am showing only 25 element first time .When user scroll down to bottom it load more data and display that more data .It is do repeat steps if user ...
0
votes
2answers
49 views
how to sort in acsending /decending order in in angular js
I am implementing the table view .In table view I am implementing infinite scroll .In other word I have 2000 objects .I am showing 25 element at one time .When user scroll to bottom it load more 25 ...
1
vote
1answer
35 views
Accessing Angular scope variable from non-angular javascript function
I have a list of values in $scope from a controller. Need to access those in a non-angular javascript function.
I have a route like:
.when("/display", {
templateUrl: ...
3
votes
2answers
48 views
How to make data available in all scopes in Angularjs
I wish to fetch data from the server-side using $http and and make it available to the all routes and controllers in my app.
Javascript code sample
myApp.factory('menuService', function($http){
...
0
votes
0answers
25 views
how to increase the width of specific column in angular + ionic
I am making a table view in ionic. I need to add condition while printing each column.
In my demo all columns have equal width, but I need one column to be 30% or anything 40% width and other rest ...
0
votes
1answer
29 views
how to use fade in and fade up on button click in angular js?
I am trying to make a simple fade IN and fade out example in AngularJS.I need show a div with slide up or slide down or fade in fade out as we do in jquery . I have search button on header (left top ...
0
votes
2answers
85 views
why after loading more data filter stop working?
there is one filter functionality in my demo I will explain my problem I have one table in which i use infinite scroll is implemented In other words when user moves to bottom it load more data.There ...
0
votes
2answers
28 views
Angular Parent Scope Variable not changing
I have a parent controller where I set instantiate an object called links. I assign a property with a value that I want to change within another function. However when I set the variable in the ...
0
votes
1answer
40 views
How to slide up and slide down in AngularJS?
I am trying to make a simple toggle example in AngularJS. I am facing one issue I need to show and hide with some animation like slide up and slide down. I have search button on header on click I show ...
0
votes
0answers
33 views
why search working stop in angular js?
I am trying to search element in table .But some time it work some time not why ?I will explain my problem I have one table in which i use infinite scroll .There is search input field in top .Using ...
1
vote
2answers
27 views
Angular JS Filter Group Select Filter
I have a users object similar to the one below:
$scope.users = [
{
name : 'John Doe',
attached_groups = [
{1:object},
{2:object}
]
},
...
-1
votes
2answers
32 views
$scope.$on changes not reflected in the view
I'm doing a broadcast and on listening to the broadcast i'm trying to updated a variable on the scope that I wanted to display on the view, but the changes are not being reflected in the view ...
1
vote
1answer
23 views
Angular ng-if for checking empty string not working
In my view, I have the below code to display some data from angular scope variables. The first two lines work fine. They display data from the scope variables but the line from ng-if does not display. ...
2
votes
1answer
34 views
Angular Directive scope undefined
I'm using a directive to parse a xls file and pass the data to a button via scope. The problem is that within the link function I'm binding to the element change event and calling a function that ...
0
votes
0answers
21 views
AngularJS Form ng-model More then 1 value [duplicate]
I'm making a multistep form and on the first step I have a list of cars with their picture and some radio inputs to select one. On this radio I have a ng-model and the value is the name of the car.
...
1
vote
1answer
18 views
Can't access $parent from ng-included controller
I'm pretty new to Angular and I'm trying to build an app.
I use ng-include to insert my view, depending on the currentURL variable of my main controller.
When I try to access the main controller via ...
0
votes
4answers
72 views
how to show only 25 element at one time?
I am trying make table view in ionic using angular js .but I have lot of data to show around 5000 object .So after getting data my UI hang because it is printing the data on dom.So I want to implement ...
0
votes
0answers
28 views
Decorating a directive by adding a function that will call the directive's controller
I use a directive that is declared like this :
(function (directives) {
var FilterDirective = (function () {
function FilterDirective() {
var directive = {};
...
0
votes
1answer
43 views
how to update all the variable changes in the service to the $scope.var in controller
I'm trying to update a variable in my controller every time a variable is updated in my service. I'm using the $scope.$watch(), but unfortunately only the last change is being effected. Here is the ...
0
votes
2answers
18 views
Unable to boradcast event from parent controller in angularjs
I have a two controller having parent-child relationship:
This is the route for parent controller:
angular.module('app')
.config(function ($stateProvider) {
$stateProvider
...
-10
votes
0answers
35 views
Console.log from template in AngularJS [on hold]
Having variable item how I make console.log(item)
of this variable in my html template, i.e. view in AngularJS?
3
votes
2answers
40 views
In Angular, is there a way to communicate imperatively to a directive?
What I know
I have a custom directive with isolate scope.
From the "outside", I can communicate to the directive using declarative bindings (via @ and = bindings).
The directive can communicate to ...
0
votes
1answer
39 views
how to reduce the height of header in tabel view or grid view?
I am trying to make simple demo of grid view .In which I have header of title (having gray background) actually I need to reduce the height of title or headers of table which have gray background ...
0
votes
0answers
34 views
scope.application.myvariable[0] not working
I'm having trouble setting an application variable. I have a input field with model name application.moreLowerSecondaryStudies[0].start. I'm using a jquery datepicker to set the date.
This is the ...
2
votes
1answer
27 views
Angular - unable to get selected ng-repeated radio button using ng-submit
I might be missing something really simple here - but if I use ng-repeat to create a bunch of radio buttons - I cannot get the selected one using ng-submit.
The controller simply attaches an array ...
0
votes
2answers
22 views
organize array when data changes
I have an array in a $scope variable that looks like this:
$scope.objects: [
{selected: true, description: 'string1'},
{selected: false, description: 'string2'},
{selected: true, description: ...
3
votes
2answers
44 views
angular directly send $scope parameter from view to service or factory
I have a factory and need to call factory from view.
i want to call factory with two parameters.
Is it possible to send $scope from template?
Because, i am using same factory for multiple places.
...
0
votes
1answer
43 views
How to add new key in existing array in angular js?
I have define blank array $scope.order, ON form submit data get and create new array then merge with existing array.
.controller('GuestDetailsCtrl',function($scope){
$scope.order = [];
...
0
votes
0answers
20 views
Finding controller name from within AngularJS?
Is it possible to find the name of the current controller in AngularJS (to use it in a function call, possibly)?
We may assume the code will only be called inside a controller.
0
votes
0answers
19 views
how to use ng grid in angular js .?
I make a simple demo of grid using ionic + angularjs .here is demo .In my demo I have two object data and displayData.from data object I need to show header of tabel and from displayData i need to ...
0
votes
2answers
34 views
Angular Modal Scope Value Not Setting
I am using Angular Bootstrap UI and using a Modal. I have a variable in my main controller that is instantiated on controller load.
$scope.links = {
imagesa: ""
};
This ...
1
vote
1answer
29 views
how to toggle orderby in angular js
I am trying to show data in ascending and descending on same button click using angularjs .I am able to show data in ascending order .But how I will show descending on same button click (as a toggle ...
0
votes
0answers
14 views
How to migrate to a controller-less AngularJS design pattern?
It seems that there is a trend in eschewing designs which lend themselves to massive and unruly controllers for a more directive-based, granular design pattern--Angular 2 seems to be promoting this ...
0
votes
1answer
26 views
How to grab value of read-only text field and use in angular js result
I have a textfield that is read only and pulling it's value from the query string. I can't get the value set in an output of javascript when bound with AngularJS.
<input type="text" ...
1
vote
3answers
25 views
Getting data from a web service with Angular.js
Im trying to get data in a Json format from a remote WS using Angular and im having some trouble.
The data comes from the web service correctly but i cant use it inside the controller.
Why is that?
...
2
votes
1answer
30 views
how to call parent function controller from directive react component angularjs + reactjs?
I have angular application and we start using react as render data.we have one problem is how can we call $scope.showUserDetails from directive react component
.I tried using ...
0
votes
2answers
56 views
how to use filter on button click in angular js
could you please tell me how to sort array in ascending or descending order on button click .Actually I have a button on header "V" .using button click I want to display data in ascending order ...