Questions tagged [angular-controller]
350 questions
12
votes
2 answers
AngularJS Upgrade (1.5 to 1.6,1.7) Makes directive scope bindings undefined
I have the following code:
angular
.module('myApp')
.directive('layout', function () {
return {
restrict: 'E',
template: '',
controller: 'LayoutController',
…

drabbitharv
- 205
- 1
- 3
- 8
10
votes
1 answer
Angularjs change view template after link clicked
I am trying to change html template after link is clicked. Value is boolean, initial value is true and appropriate template is loaded, but when value changed to false new template is not loaded, I don't know the reason. When initial value of boolean…

Nedimo
- 307
- 3
- 9
- 21
8
votes
1 answer
Error: $controller:ctrlreg The controller with the name '{0}' is not registered
app.js
(function(){
'use strict';
angular
.module('app', ['ngRoute', 'ngCookies'])
.config(config)
config.$inject = ['$routeProvider', '$locationProvider'];
function config($routeProvider, $locationProvider){
$routeProvider
…

Mat.Now
- 1,715
- 3
- 16
- 31
6
votes
1 answer
Angular Stripe - Converting Stripe Payment Form to Stripe Elements
I used to have Angular Stripe Checkout form and I am trying to update my form to the new Stripe Card Elements which was introduced recently.
After removing the Form Input fields and replacing them with the Stripe Card element, my form looks like…

Neel
- 9,352
- 23
- 87
- 128
6
votes
2 answers
how to Create AngularJS charts with dynamic data
Hi im trying having a webpage that displays the sentiments of tweets of politicians. I am trying to create a chart for the sentiment statistics. I am using Zingchart and i am able to create for static data but i am not able to create for dynamic…

Cocoa
- 63
- 1
- 6
5
votes
2 answers
AngularJS - Multiple Directive Instances making XHR call multiple times
I have an Angularjs directive 'ExampleDirective' which has the controller 'ExampleController'. The controller defines two Promise objects where each Promise object makes an Http GET request and returns the response.
In the directive, we get the…

nael
- 1,441
- 19
- 36
4
votes
5 answers
Angular JS only one controller working when i used multiple controllers in a single page
Problem in handling two controller
As am a learner to angular Js this is where i got my
confusion
I wrote two with two different apps and controllers and apps
as I have learnt we can define multiple of these in a single page.
The first part div…

KishanCS
- 1,357
- 1
- 19
- 38
4
votes
1 answer
AngularJS $scope is not updating in DOM
I have the following codes :
The state (lets just make it short for simplicity purposes)
.state('foo', {
url: '/foo',
templateUrl: 'path/to/template.html',
controller:'fooCtrl',
})
The controller
controller = function($scope){
//…

jofftiquez
- 7,548
- 10
- 67
- 121
4
votes
2 answers
AngularJS: how to assign service method to controller $scope and ng-repeat (it) in view?
I'm trying to separate functionality from controller and put it in service so I can use it in multiple controllers without adding same piece of functionality across different controllers.
My original controller, before I was trying to configure it…

Daniel T.
- 369
- 2
- 6
4
votes
1 answer
AngularJS how to use ng-model inside a custom directive tag, setting the controller dynamically?
I started in Angular recently, so I have some questions.
My problem:
I created a directive that I will use in many 'pages' with different controllers in each situation, for example. Now I can set the controller dynamically well, this problem is…

LeonardoGuimaraes
- 275
- 3
- 17
3
votes
1 answer
Get data between two controller that there are no any relation them in angular.js
I have two controller that they aren't any relation and want to know smtg in controller1 when happen a change in controller2.
like this: Update smtg in controller2 after changing controller1 to understand that.
export class Test1Controller{
…

Omid Sotooni
- 159
- 5
3
votes
1 answer
Angular 6 - How to change a component's value in its template on a IF condition
I'm trying to display or hide the below 'separator-container' if any one of the row data satisfies some specific condition (as in 5th line of code "myConditionCheck").
I tried achieving it by having "isWarningSeperatorVisible" as controller class…

Avengers
- 33
- 5
3
votes
1 answer
AngularJS - Inject $factory into controller
I have multiple factories registered, say Circle, Square and Triangle, and a controller called ShapeController. Inside of ShapeController, I'm trying to retrieve one of the factories using its string representation, in the same that I can fetch a…

Girrafish
- 2,320
- 1
- 19
- 32
3
votes
2 answers
How to split an AngularJS code in separate files?
Everything is working but when I try to separate my script to external js files, AngularJS is not running.
Here is my script: