0
votes
0answers
23 views

Assign included JS function to AngularJS scope

I am including a function from my webserver, and I need to include this existing function to my AngulerJS scope so I can use it in my view. I have tried this: $scope.getSymbolName = get_symbol_name ...
0
votes
0answers
28 views

Ok to use element.addClass in angular?

Loving using angular but want to keep to the "best practices" and not get into bad habits. Currently making a desktop application which is also available on mobile devices and found the bindonce ...
3
votes
1answer
26 views

AngularJS Directive Binding link: has no access to scope variables

I'm trying to write my first AngularJS Directive; it's basically a piece of code that blurps out a number of stars (badges) out of a maximum number of stars. The link: function() code in the ...
0
votes
1answer
15 views

Angular.js: Store div content in scope variable

I have an editable div and I want to store the HTML content in scope variable scope.myText: <div id="editor" contenteditable="true" ng-model="myText"> <p>HTML Text</p> ...
0
votes
3answers
19 views

AngularJs Injector Module Error

i'm new in AngularJs (started an couple hours ago) and i'm trying to complete the AngularJs in 60 minutes'ish tutorial. But i got stucked on the first controllers example. This is my code: ...
0
votes
2answers
14 views

Directive at angularjs and custom method/html

I have this code: <body ng-controller="testController"> <div test-directive transform="transform()"> </div> <script type="text/ng-template" ...
0
votes
3answers
29 views

why my ajax success data is not display in angular js

I am trying to call ajax and get my HTML contend .But I want to show that data on tooltip/or pop over .I am getting the data on console I don't know why it showing black data tooltip it is showing ...
0
votes
3answers
28 views

Watch element on directive

I have the next code: angular.module("Test", []) .directive("testDirective", function () { return { restrict: "A", scope: { model: "=" } link: function(scope, element) { ...
-1
votes
0answers
19 views

AngularJS - Adding CSS classes to siblings

I am trying to add a CSS class of open a DIV's sibling. Here's my HTML: <div id="profile-information"> // Code </div> <div class="profile-info"> <div ...
0
votes
2answers
40 views

$on event, set a variable to true

This is a dumb scoping issue and I'm bad at javascript. Pretty sure I dont know how to return the value of a variable up to parent scope (ex. look for the **** in AppCtrl)` I have 2 controllers. ...
1
vote
0answers
16 views

How to do a javascript profile of angular $digest

I have a web app with portions written in angular, I have been using debugging tools to get information about how many times $digest is called and how much time it is taking. How can I get this ...
0
votes
0answers
42 views

TypeError: Cannot call method 'then' of undefined

This is part of the code that shows the error. I tried to add modal functions (pop up input page) from Ionic framework and thats where all the errors start coming in. The error is a long list of ...
0
votes
1answer
27 views

Scope not updating inside a function in a different state

I have two states using the same controller, when I trigger a function from State 1, I want it to go to state 2 and changes its title as well, here's my code: $scope.page2Title = "Testing"; ...
1
vote
1answer
37 views

Should angular $watch be removed when scope destroyed?

Currently working on a project where we found huge memory leaks when not clearing broadcast subscriptions off destroyed scopes. The following code has fixed this: var onFooEventBroadcast = ...
2
votes
1answer
44 views

Controller not a function, got undefined, while defining controllers globally

I am writing a sample application using angularjs. i got an error mentioned below on chrome browser. Error is Error: [ng:areq] ...
-1
votes
1answer
45 views

Query not working for me

I am using angularJs ng-resource.I have tried this angular.module('app.services', ['ngResource']) .factory('AngularIssues', function($resource){ return $resource('../test.json',{},{ ...
0
votes
2answers
35 views

Pass a input field value into angularjs $resource undefined and error shows unknown scope provider

=========================================================================== Update 1 Fixed code produce new error of ReferenceError: inputName is not defined on the line of ...
0
votes
0answers
30 views

Have $watch trigger other function in object

I want to have an object which can listen to certain parts of it using $watch but then call another member function whenever the watch is triggered. I'm not sure if the way I am currently approaching ...
2
votes
3answers
28 views

AngularJS binding response from server not updating in view

I am developing a mobile application. I encountered a problem while trying to relay messages in the view that was returned from the server after an ajax call. The idea is to display the message in the ...
1
vote
1answer
26 views

angularjs and ng-init scope when data changes

So I have a calendar application where right now the user chooses start/end dates and clicks update calendar. This populates a calendar. However, I'm having trouble including new elements in the ...
3
votes
3answers
30 views

Using $scope.$watch when using `this` scope in controller

I have a controller in my Angular app: (function (angular) { function MyController() { this.name = 'Dave'; // I want to have code like this: /* ...
0
votes
1answer
40 views

Angular JS Use modal in ng-repeat list

I am displaying a list using AngularJS's ng-repeat... Below is the template per list item; It all works except for the {{...}} that are used inside bootstraps modal. It 'almost' works the way it ...
1
vote
1answer
22 views

Trouble getting size of an array in a js object inside controller

I want to get the size of some data I am retrieving in my controller - I have tried the following code; both utilizing a new Object.size function and attempted to get the length property directly ...
0
votes
2answers
32 views

Angular. Ambiguous $watch behavior for sync and async code

I have an exapmle where value for watched variable can be set in current stack or can be loaded asynchronously (it is incapsulated code). So, i can not be sure, if the value was changed, when the ...
1
vote
3answers
36 views

AngularJS - How to filter date in controller

I have a JSON file returning a number of dates in such format: /Date(1235548800000)/ How can i filter this in my Controller to only return the year? I have tried: var filteredDate = ...
0
votes
1answer
37 views

how to load html in while making pop over?

I make a pop over .But I insert my pop over content in same html file.I want to load popover contend from another file and load the contend using templateURl :can we do that ? Here is my demo HTML: ...
0
votes
1answer
26 views

Advice on workflow for an 8 step application with ANGULAR.js

I'm creating an application with Angular.js and I'm getting a bit confused of how to use Angular to make it. Below, you can see a preview of what I have for the moment, it's ugly but it works. I ...
2
votes
1answer
44 views

Global back/next buttons in AngularJS

I have some navigation buttons on an Angular wizard-style webapp. For cosmetic reasons they need to be removed from each partial and added to the root "index.html": <!-- Global navigation buttons ...
0
votes
1answer
23 views

How to bind to the result of a function in AngularJS

I have an array of items that I want to keep track of across several controllers. So, to do this, I made a service. The service is basic for now, just adding items to an array and the ability to get ...
0
votes
1answer
36 views

How can I add each element of one array to corresponding elements in other arrays with javascript or angular

I need to add the elements of arrays together in order, very similar to the question at [How can I add each element of one array to another one's corresponding element using a ParallelStream?, but ...
0
votes
0answers
20 views

Why is ng-class not working on my directive when I change a scope variable by using broadcast? [duplicate]

I have a directive which is a toggle button to change the theme of the page. The code for the directive is... app.directive('twoOptionThemeSwitch', function () { return { scope: {}, ...
0
votes
2answers
54 views

How to get a $scope object to an angular service

I have an object that I am modifying on $rootScope where I am "storing" my last search parameters. Currently I have the values returnType, rows, and query hard coded. I would like to those just be ...
-1
votes
1answer
20 views

Call a function when i click outside to the element like boot strap modal get closed

I have created a popup box of div. Which get shown when i click on an icon and get hide when i click on close button. But i want to get it closed id i closed out side of that popup. What i can do for ...
0
votes
2answers
57 views

How do I allow for clicking on each item/post, then viewing it in a new screen?

Im trying to build a simple tutorial app list of grocery items, and then clicking on it will lead to a new page showing the grocery goods in details, such as price, quantity left etc. Currently, ...
0
votes
1answer
38 views

Calling a function in a directive from a controller in Angular with isolated scope

I have a directive which is essentially just a search box with multiple parameters. In the controller, the search function requires access to a function called getOptions() which is used to get the ...
0
votes
2answers
55 views

Why is the binding not working for $scope in controller?

I'm new to Angular. I am having problems dealing with variables back and forth between my controller and html. In my controller not only I want to read $scope, but I also want to use it in a function ...
1
vote
1answer
35 views

Pass parent scope variable to a directive as an attribute

I'd like to build my own version of an Angular checkbox that uses ng-model. (Documentation here: Checkbox in Angular) I've built my button, but am not sure how to link it up to ng-model. Here's a ...
0
votes
0answers
29 views

AngularJS: Execute controller function from a nested directive

I have a question regarding executing a function (defined inside a controller) from a directive, but with another directive between these two (so this directive just passes forward the function). I ...
0
votes
1answer
37 views

How to use ternary in ng-init in AngularJS? [duplicate]

Is it possible to use ternary operator in ng-init in AngularJS ? Something like : <select ng-model="project" name="act" ng-options="act.user_id as act.user_display_name for act in actors" ...
1
vote
1answer
15 views

How to create an alias for members of the current scope

I have a piece of html which i use with ng-include. This template is used recursively and expects a scope/controller (sorry, i don't know the correct word in that case) with the name "element": ...
0
votes
1answer
32 views

Can not chage angular $scope with ng-click

I am trying to change directive controller's $scope with ng-click. I have one simple button: <button ng-click="showEnterKeyField = !showEnterKeyField">btn {{showEnterKeyField}}</button> ...
0
votes
2answers
34 views

AngularJS Dynamic Filter Configuration fail to resolve

I'm a newbie to AngularJS with some fair knowledge with KnockoutJS also. I'm trying to implement a search feature on 'products' in my ViewModel that is configurable by the end user by combining.. ...
0
votes
0answers
26 views

How do you access ng-model's scope value within a directive that is using transclusion?

I have an application controller that is responsible for adding users to another Model. There are two ways to add users in my application. We can add them by selecting the users themselves, or by ...
1
vote
2answers
34 views

Nested JSON not display in ng-repeat

I'm having trouble accessing the nested JSON using the ng-repeat directives. I know it is working because the not nested part of the JSON object is displaying. Here is a plunker of my code: ...
0
votes
4answers
30 views

Iterating list from Angular controller setting scope

I am making a call to my backend, which returns a list of objects as JSON. Now, I want to iterate these in the frontend in my Angular app. However, when the HTML i wrote below is rendered, nothing is ...
1
vote
1answer
73 views

Is it improper, and if so why, to pass $scope to a service in Angularjs?

Are there strong reasons one should not pass $scope to a service? I realize services are to be reusable singletons and so passing a (potentially) large object to the service might have maintenance ...
2
votes
3answers
23 views

Do you have to us ng-Controller in the view or can you just declare it in the $routeProvider?

I recently realized I had not used ng-Controller to declare the official scope of my controller in the HTML but had only mentioned it in $routeProvider and all APPEARS to be well. Does any one know ...
0
votes
2answers
40 views

onDblclick of a directive: toggle its boolean attribute value

I have a directive called contentEditable which is also referencing the html5 attr ::docs::. <p contentEditable="{{edit}}" ng-model="pages.title">default</p> on dblclick of directive, ...
0
votes
1answer
20 views

$rootScope:infdig error in AngularJS when using ng-disabled to validate a collection of elements

I've got an issue with an AngularJS app I'm writing, and I've created a very simplified version of it here: http://plnkr.co/edit/55JlCxVV1SSKfcQgbICb?p=preview My issue is that, when using ...
3
votes
2answers
72 views

One controller's scope blocks other scopes in Angularjs

I have a set of tabs which all have a directive in them: <div class="col-md-9 maincols" id="formEditor"> <tabset> <tab heading="New subscriber" ...