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
1answer
17 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
26 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
19 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
15 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
26 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
60 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
24 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
29 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
28 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
27 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
32 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
21 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
43 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
18 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
16 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
29 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
13 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
26 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
16 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
52 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
33 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
21 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
100 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
51 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
68 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
44 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
43 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
99 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
31 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 ...
0
votes
2answers
44 views
What exactly 'this' means in AngularJS controller?
index.html
<body ng-controller="StoreController as s">
<h1 ng-click="s.changeValFunc()">{{s.carname}}</h1>
<h2>{{s.carname}}</h2>
</body>
app.js
var app =...
1
vote
2answers
68 views
Controller not defined AngularJS
I get this error when I try to run my application.
Argument 'CampaignsSettingsController' is not a function, got undefined
My controller is defined here:
// Called Second
var ...
1
vote
1answer
236 views
Getting error when pass data between controllers using sample service
as part of angular js learning, i created small app that will pass the data between two controllers using services..below is my code to pass the data between two controllers..
Controller code
<!...
0
votes
2answers
32 views
Can a controller be in a seperate file when using ng-view?
Currently I am learning AngularJS. I have made a 'hello world' app that displays through the ng-view directive. So far so good!
My files are ordered in this fashion:
- WebContent *(root)*
> - ...
0
votes
1answer
62 views
Passing a directive to directive via an object in angularjs
Lets say there are 2 directive components
1) List
2) Profile
"List" should accept the data in the form of Object notation passed to it through the controller and display the HTML or Directive ...
0
votes
3answers
60 views
how angular directive bind controller's service data
controller:
service.checkSub(function(data){
$scope.showSub = data.subscribe? false : true;
})
directive:
app.directive('showSub', function() {
return {
restrict: 'E',
...
0
votes
1answer
37 views
Simple AngularJS Controller Demo Not Working
I have been using AngularJS for some time now and this particular code block is not difficult by any means, but it's not working and there must be something extremely simple that I am missing here:
&...
0
votes
0answers
31 views
Change element style before and after BootstrapModal action
I'm new in Angular and I want to know that is there a possibility to change <div> style using directive.
Here is the function that is in controller:
$scope.importData = function () {
...
0
votes
1answer
17 views
Combining Nearly Identical Controllers
In my angular application, I have two tables, each with their own controllers. These two tables use ng-repeat to present information retrived from a REST API. The controllers for these two tables ...
1
vote
1answer
51 views
Where should I place code to be used across components/controllers for an AngularJS app?
Should it be associated with the app module? Should it be a component or just a controller? Basically what I am trying to achieve is a common layout across all pages within which I can place or remove ...
0
votes
0answers
25 views
What happens when you do not use $destroy() after creating an instance using $new() when unit testing AngularJS
I was looking for ways to unit test AngularJs when using the "controller as vm" style. I came across this (Karma jasmine and angular controller using 'Controller as' syntax (this instead of $...
0
votes
2answers
125 views
AngularJS, Catch a response from a service and use it in a controller
I have created a service and I have a responce, but I don't know how to use that responce into a controller.
The service that I have:
angular
.module('MyApp')
.service('telForm', function($http){
...
-1
votes
1answer
23 views
How do I use this format of JSON in ng-repeat
This is the JSON and controllers im using:
JSON Format:
{"networks":[{"longName":"lo"},{"longName":"eth0"}]}
Factory:
app.factory('networkFactory', [ '$http',
...
0
votes
0answers
62 views
Removing a AngularJS component from the DOM and from his parent on click
i'm trying to show a list of users in AngularJS
Each one would be user with a custom component element
The components would have TWO buttons
First one have to remove the component element from the ...
0
votes
3answers
70 views
How to isolate child controller scope from parent controller scope without changing the view?
Click on the parent button change also child but child button not.
I need to change this behavior isolating scopes whith any hacks or other way.
Child controller doesn't inherit from parent ...
1
vote
2answers
47 views
AngularJS - Data is not populating in table while using http service
I have a Web API which retrieves list of employees. Now when I call to $http service, I can get data from WebApi but it neither populated in table nor gives any error.
Note: I am using angular v1.5....
1
vote
1answer
53 views
How can I call the function in controller from service
I would like to ask if is posible call function getItems(); in ItemController controller(It loads list of data) from fileUpload service(after upload image) - exaple bellow.
After upload I want to ...
0
votes
1answer
33 views
Change in controller not reflected in view
I have 2 controllers based on the action taken in one controller, I need to update the data in the other.
This is my code
Controller 1
$rootScope.$broadcast('PackageIns', $scope.pkgtoLoad);
...
2
votes
2answers
47 views
share data between controllers getting/setting data asynchronously from a service - AngularJS
I'm having trouble with getting my custom angular service to work.
My service is as follows:
app.service('userService', function(){
var user = [];
var setUser = function(newObj){
user.push(...
0
votes
1answer
59 views
Argument 'myController' is not a function, got undefined
I'm trying to setup some controllers in my angular app but I'm not sure why I can't make them working, since I think I'm using similar approach as I've done before.
I declared app.js file:
'use ...