The AngularJS controller exposes the data that is to be displayed into the HTML view. It plays the essential role of the ModelView in the MVVM design pattern. The view is a part of the HTML template.
0
votes
0answers
7 views
angularjs 1 manual bootstrap doesnot work
I am new to angularjs.
I tried to create 2 different modules in an single js file and them manually bootstrap one of them to a element. This was suggested in one of the stackoverflow questions. But ...
1
vote
1answer
21 views
AngularJs: Route Provider For Tab?
I am new to AngularJs. I am working in Angular Routing Concept. There are plenty of suggestion and examples are available for Routing and i am researching it. But its not fulfilling my requirement. I ...
0
votes
3answers
31 views
AngularJs: How to initialize the value for function Which is returning NaN?
I had a problem on my code in angularJs function which is return NaN instead of 0 during initialization.
Sample Code is Here
var app = angular.module('myApp', []);
app.controller('personCtrl', ...
0
votes
3answers
37 views
AngularJS, calculation addition (+) is not working
I tried to calculate $scope values through angular controller. For instance: the below code works in order to multiply values inside brackets. However, addition(+) is working like 400+200 = 400200. ...
0
votes
1answer
32 views
angularjs form validation shows success on page load with empty form
I have the following form, but some field are showing the success messages below the box on page load, without even touching the form.
What is the problem?
Here is the controller:
app.controller('...
2
votes
2answers
32 views
AngularJs: How to call the angularjs function by Pressing tab button after entering text in the text box?
I am wondering how to call the angularjs function by Pressing tab button?
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
});
<script src="...
2
votes
1answer
29 views
After loading a new route old instances of controller is still running
I have a route which is loading a page based on the parameters:
.when('/:num/:den', {
templateUrl : 'app/views/templates/home.html',
controller :"ProductContoller",
controllerAs: "product",
...
1
vote
2answers
49 views
AngularJs ng-repeat : how to bind the values from <input> which was inside the ng-repeat?
var app = angular.module('myApp', []);
app.controller('myCtrl',function($scope){
//Adding New Check# and Check amount Text Boxes
$scope.texs = [{id: 'tex', value: 'tex1'}];
...
1
vote
0answers
25 views
Getting controller reference in service with $controller
I am new to Angular, but I am working on a service class that I have need to get a reference to a Controller by name.
This particular service is used in the navigation, and setups a listener on $...
1
vote
2answers
48 views
How to manipulate the <title> of an AngularJS single page app?
I have a single-page AngularJS app.
The index.html file looks like this:
<html ng-app="myApp" ng-controller="MyCtrl as myctrl">
<head>
<link rel="stylesheet" href="my-style-...
0
votes
3answers
39 views
How to add a progress bar in ionic app
I really need your help, I am new to ionic project. Currently working on a project. This app pulls blog post from wordpress using $http. How can I add a progress bar to tell the users that the page is ...
0
votes
1answer
39 views
AngularJS Controllers
Recently faced angularjs controller behaviour. Someone accidently from team did structured DOM like this : -
<div ng-controller="firstController">
<div ng-controller="secondController">
...
1
vote
1answer
25 views
AngularJS isolate directive - data not binding in .controller (but works in .link)
A custom directive was created in AngulerJS 1. It has in isolate scope, and is data-aware (gets data from server API). Its definition looks like this:
var dirJobView = function ($location, ...
0
votes
1answer
13 views
Angular injector error with Filestack
I am attempting to integrate Filestack into an existing app. I think I am having issues with how those modules are configured, but can't get the ordering correct. I receive this error:
angular.js:...
0
votes
1answer
43 views
use jQuery.matchHeight from Angular directive
I am trying to set elements to the same height using jQuery.matchHeight. I call the function from an Angular directive
angular.module('myApp')
.directive('matchHeight', ['$timeout', function ($...
0
votes
2answers
26 views
Does controllerAs work with Isolated Scope?
I'm familiar with using controllerAs, but do not understand why, when using with isolated scope, none of my controller properties are showing up on the scope.
Here's a plunker showing what I'm ...
0
votes
1answer
35 views
Load image using AngularJs
I have create a simple web site using angularjs and bootstrap.
In one page, I load a static image and I set some botton on this using bootbox.
When I run in local my site using
grunt serve
I see ...
0
votes
1answer
21 views
Pass Array from Controller to Factory error
I have a factory thats using angular-websocket to connect with a backend and I need to pass info from my controller to it so that it would send that info and I want to pass it as an array.
Factory is ...
0
votes
0answers
62 views
Sharing data between controllers using $broadcast
To share data between controllers it is common to use service.
I found that using $rootScope.$broadcast is really convenient if the data I have to share is a [] or an {}.
For me the advantage of ...
0
votes
1answer
20 views
Passing Data from Service to Template via Controller and $stateParams
I have a service with the following code:
.service('ChatService', function() {
return { //Gets Data from controller
sendData: function(data) {
this.chatData = data;
console.log('...
0
votes
1answer
19 views
Trouble accesing JSON file with angular
This is the JSON and controllers im using:
JSON Format:
{"tomcatLogDir":"C:\\apache-tomcat-7.0.70\\logs","tomcatLogs":["1.log","2.log","3.log"]}
Factory:
app.factory('filesFactory', [ '$http',
...
0
votes
3answers
30 views
Unable to get controller loaded into my angularjs module
I'm trying to split my angularjs controllers into files but failing everytime.
Directory Structure:
--public--
--js/controller/resturant.js
--js/master.js
--index.php
Code ...
1
vote
1answer
31 views
Firing event from dynamically opened controller to parent controller in Angular js
I am developing an Web Application using Angular JS. Frankly, I am new to Angular JS. in my app I am using bootstrap.ui js for angular js. But I am having a problem with bootstrap modal controller. I ...
0
votes
1answer
22 views
Pass Data to Service from Controller AFTER receiving info from Server
I need to pass data to an array in service after getting from server. The controller runs the function to retrieve data as shown
.controller("messagesController", function($scope, $stateParams, ...
0
votes
2answers
27 views
Cannot declare controller in Angular Js
I am developing an Web Application. In my application, I am using Angular JS. Frankly, I am new to Angular JS. But now I am having a problem my declaring controller. Please see my code below.
<...
0
votes
2answers
24 views
use values to call factory's function in angular
Im trying to call the factory function from a controller using values but im getting a TypeError
Controllercode
$scope.onButtonHovered = function(event){
console.log("event.descriptorName "+ event....
3
votes
3answers
65 views
Difference between specifying objects on 'this' and returning the objects itself in a function [duplicate]
I'm a total newbie to javascript. Was just wondering what is the difference between the following when using the controllerAs approach, and why the second approach doesn't work:
angular.module("app")
...
1
vote
1answer
25 views
Picture won't display as part of my little angularjs app
I wrote a little app that converts Fahrenheit to Celsius and I want a picture to display based on the Fahrenheit temperature. I can't get the picture to display. Can someone tell me where I'm going ...
0
votes
1answer
43 views
Retrieving model values from dynamically opened controller's scope in Angular js
I am developing an Web Application using Angular JS. Frankly, I am newbie to Angular JS. Very new. In my app, I need to dynamically add and remove elements. I use directive for it. Adding and removing ...
0
votes
1answer
32 views
Calling a parent controller's function in the parent's context
I need my parent controller function getDataInParent to get called in the parent's controller's context itself.
Sample:
The child directive is correctly setup like this from within the parent ...
1
vote
2answers
29 views
updating variable in http request callback in angular
This is probably easy but nevertheless. I have a http call in my controller where I load a json file. I want to update a variable in my html based on a result. It updates apparently the variable (...
0
votes
2answers
38 views
Controller data not passed to directive
I started looking into angular and cannot seem to figure out why my data is not passed to my directive. I have code here: https://plnkr.co/edit/ONwYevQ4NbvBVjTwARHl?p=preview
My Code:
app.js:
var ...
1
vote
2answers
27 views
Service undefined when injected into controller
I have a controller that I have injected a factory into but it comes back as undefined when I call a method on that factory. Not sure what I am doing wrong here. Any help would be appreciated.
...
0
votes
2answers
48 views
Angularjs - How can editable data be shared between run, factory and controller blocks?
tl;dr - app.run resets $rootScope.variable's value every time I invoke an API - I need help finding a way around that.
I have an AngularJS + ASP.NET Web API setup. I need AngularJS to send a token in ...
0
votes
0answers
23 views
How to set multipart mixed data returned from rest service to angular js controller object
I have to render json data and QR code image returned as byte array to angular js controller. I am getting the multipart/mixed result from rest service as follows:
"--uuid:10f48a0a-4ecb-43be-834f-...
2
votes
0answers
17 views
Passing data between angular controllers
Below is the sample code where I am trying to pass/sync the value between the two controllers. For the same in view I have a textbox and two place holders for showing the value of the textbox.
I ...
0
votes
1answer
33 views
Anguarjs Directive or Controller to seperate views components
I'm trying to learn Angularjs (1.5) I have already understood the concept of filters and services and I've also understood logic behind controllers and directives too. But when I started to write my ...
0
votes
0answers
14 views
How do I create a filter that will limit my character count but not include the HTML markup as part of that character count?
Currently my code is:
<div ng-bind-html="job.description | limitTo : careerlist.limit">
</div>
but the issue I am running into is that job.description includes html markup which causes ...
0
votes
0answers
38 views
Declaring angular controller inside visualforce component not working
I have several visualforce components with inline corresponding
angular controllers. Those are working fine if I'm loading them in
individual visualforce pages. But its throwing Error: [ng:areq]
...
0
votes
0answers
19 views
ReferenceError: FieldSetController is not defined (APEX)
I have a angularpubsub.js which has all the angular factory and services . I have another file controller.js
which has all angular controllers for individual visualforce components. But when I'm ...
0
votes
1answer
66 views
Defining angular controllers and component
I'm trying to call a function from within one angular component's controller to another component's controller. I found this answer, but the controllers are defined differently than what is shown in ...
1
vote
1answer
44 views
reference form in angular component without scope
Currently I have this component definition:
var controller = ['$http', '$timeout', '$scope', function($http, $timeout, $scope) {
this.isInvalid = function() {
return $scope....
1
vote
0answers
22 views
Best way for a form controller to expose parsed data from the form it manages?
I come from a Java background and am getting up to speed on Angular 1.5.8+typescript.
I have a form controller that crunches the raw fields from a form and produces a data structure. An example of ...
0
votes
1answer
257 views
How to pass ngModel to AngularJS component without 2-way binding?
I have custom input as AngularJS 1.5 component with one-way data bindings and ngModel as two-way data binding:
return {
bindings: {
form: "<",
fieldName: "@",
minLength: "...
2
votes
1answer
58 views
injecting a list into a json format
I'm new with angularJs and i want to inject a list of string that i get it using a restful web service into a jSON list.
And how can the connections list could proceed object returned by ...
0
votes
2answers
290 views
angularjs controller access directive scope value
I have this controller with directive inside my html code. The directive have scope value I would like access from the parent controller and show in the html. Hope my example code give you a simple ...
1
vote
3answers
58 views
Why is AngularJS Controller not working on my pc?
I have started learning MEAN Stack and wanted to try some code but AngularJs Controller is not working on my PC. I have windows 10 on my Acer Aspire V Nitro.
Can anyone please help. Will be highly ...
3
votes
1answer
58 views
scope issue with ng-view, parent controller, custom directive
I'm so confused about my situation. Let me briefly introduce my situation.
HTML structure. (It's just structure, full HTML is more than that but there is no any other controller except "...
0
votes
0answers
108 views
Why isn't my AngularJS view updating?
(Update: still haven't solved this.)
(Further update: I've had no further responses from anyone. Surely this must be solvable?)
I'm combining Angular and D3, which I think is causing some problems. ...
0
votes
2answers
34 views
AngularJS updating form with select and passing parameters into controller
I have a pretty simple itemController which contains an array of items (in actuality, these are obtained from an API). I want to then call the API again to get the subsections based on what is ...