-3
votes
0answers
24 views

how to pass json object between different controllers in angular js? [duplicate]

Like in asp.net mvc, we use ViewBag, ViewData, to pass in objects between different views. How do i pass in a Json Object between 2 different controllers using angular js?
0
votes
1answer
22 views

Where is the controller placed using $routeProvider?

With ng-controller="myController" you know exactly what DOM element is associated with the controller, because it's put directly into your HTML: <div ng-controller="myController"> with ...
1
vote
0answers
31 views

getting an error : Argument 'ctrl' not defined in angular js

my index.html file has the following : <script src="scripts/controllers/form/DashboardCtrl.js" /> <script src="scripts/controllers/chart/morrisChartCtrl.js" /> my app.js file is as ...
0
votes
1answer
42 views

How to get the actual current controller on $routeChangeSuccess

I have a global routechangesuccess event handler for tracking route changes as "Page Loads" to our analytics platform. Currently, I am using the current controller name in the routechangesuccess ...
0
votes
2answers
33 views

AngularJS load in controllers that are in separate files

app.config(function($routeProvider) { $routeProvider // route for the home page .when('/demo', { templateUrl : 'assets/pages/home.html' }) ...
0
votes
1answer
107 views

How to pass $scope data between two partial files in angularjs

How can I pass data in two partial html files using angularJS, totally weird cant get through it. I have one index file [fine.], I login and reach view5 [partials/blog.html] which is written in ...
0
votes
0answers
101 views

Angularjs initialize multiple controllers at startup?

i have a normal navbar with a menuController, this is the parent. then i have two other controllers a DashBoardController this is loaded on startup and a LoadDataController this is called if i click ...
0
votes
1answer
49 views

Loading the partial file after fetching the data from ajax call

I am loading a partial file which fetches the data using a ajax call. The issue is the partial file gets loaded immediately once the link is clicked on the browser but the data will be populated after ...
3
votes
2answers
81 views

specifying AngularJS controller: benefits using ngController vs. $routeProvider

There are two ways (AFAIK) to associate a controller with a view template/partial: the route specified in $routeProvider and the ngController directive. Especially (but not exclusively) for simple ...
1
vote
1answer
97 views

ngRouter/uiRouter preserve controllers when changing view

Is there anyway to preserve route controllers in Angular when using routing? Everytime I change the view, the old controller is destroyed and a new one created, but I was wondering if there was a way ...
0
votes
1answer
177 views

Routing with controllers in these html pages, is it possible?

I'm new in AngularJS development and I'm actually in front of a problem. In my index.html I have already many scripts included like that : <script type="text/javascript" ...
0
votes
4answers
127 views

Angular JS - Preventing a controller from running

So I'm doing a simple 'is the user logged in' check and redirecting the user to the signin.html page if they are not logged in. My code looks something like this: var myAppModule = ...
1
vote
1answer
90 views

Creating a controller to each view in angularjs

I'm beginner in AngularJS and I want to create a controller to each view, but this file only can be referenced when I load the view, so: my app.js: var app = angular.module('app',['ngRoute']); ...
0
votes
0answers
255 views

Dynamic routing with dynamic controllers in AngularJS

I am currently using require.js and angular. Since I have a very long list of custom views, each for a different task, I've cooked up a way of including them dynamically using requirejs. First a ...
0
votes
1answer
255 views

Controller doesn't work after URL change

In short: I have a controller that triggers some jQuery in my AngularJS web page to fade out a play button and a corresponding image. But, when the URL changes, the controller fails to work on ...
1
vote
0answers
400 views

AngularJS - “10 $digest() iterations reached” when ng-view ng-repeat dependant on $routeParams

I am really new to Angular and this is the first time that I am dealing with routing, so please excuse me if my questions are a bit confusing. My actual logic and structure for this app is much more ...
1
vote
1answer
1k views

AngularJS Controller $scope not displaying variable

I am new to AngularJs. In app.js I have the following angular.module('module1', ['module2']) .config(function($routeProvider) { $routeProvider .when('/', { ...
4
votes
3answers
8k views

Simple Angular $routeProvider resolve test. What is wrong with this code?

I have created a simple Angular JS $routeProvider resolve test application. It gives the following error: Error: Unknown provider: dataProvider <- data I would appreciate it if someone could ...