-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?
1
vote
1answer
21 views

Angular js api url call not working

app.controller('Ctrl', function ($scope, $http) { $http({method: 'GET', url: "/api/v1/coupons-dunia/coupons-by-website?websiteId=1"}).success(function(data) { $scope.onlinedata = ...
0
votes
1answer
17 views

Show form using custom directive - AngularJS

I have a button with ng-click function. When I click the button, it should show the form which is coded in a templateUrl using a custom directive. Which function should I use to get the screen ...
0
votes
0answers
23 views

fetching the selected dropdown value in AngularJs

I have a dropdown menu which I coded using Bootstrap and I populate the data form the scope. How do I fetch the selected value from the controller whenever there is a change in the dropdown field. ...
0
votes
2answers
22 views

calling ng-view controller method from outside controller?

HTML: <html ng-app="san"> <head> </head> <body ng-controller="sanctrl"> <div> AngularJS</div> <div ng-view=""> </div> <button type="button" ...
0
votes
0answers
52 views

How to stop changing routes in angular js

I am new to angular. I am trying to stop navigation to the index page if the user is already logged in. That means I use a cookie by applying the following code. app.run(['$rootScope', 'authService', ...
0
votes
1answer
22 views

Can not prevent accessing to a specific route using $routeChangeStart

in angular js i have a routing function that should manage access to routes for admin and non admin users so i used to $routeChangeStart achieve that according to my logic if a user is logedin he can ...
0
votes
0answers
16 views

conflict with routing on route updata

on angular i have very strange error i have defined that method so i can manager access to routes basically what i am doing is if the user is logedin he goes to home page another than that he should ...
0
votes
2answers
53 views

Multiple AngularJS apps on page

I'm a noob in AngularJS, therefore sorry for stupid questions. What I'd like to do is to use the same application in two (or more) places on a page. For that I've created two HTML elements and have ...
1
vote
1answer
53 views

AngularJS routing with id parameter ends in white page

var app = angular.module('application', [ 'ngRoute', 'ui.bootstrap' ]); // configure our routes app.config(function($routeProvider, $locationProvider) { $locationProvider.html5Mode(true); ...
2
votes
4answers
60 views

AngularJS AppCtrl wait for HTTP event to success

I'm all new to AngularJS and need some help, I have a "AppCtrl" and from there I have a HTTP webservice call - and need the webservice call response accessible in my other controllers. ...
0
votes
1answer
33 views

Scope inheritance fails with multiple-named views?

It breaks when moving from (Plnkr): .state('home', {url: '/home', template: '<pre>{{parentProp}}</pre>', controller: function ($scope) {$scope.parentProp = ['home'];}}) ...
0
votes
1answer
45 views

Dynamically switch ng-include between controllers

I have the following bit of code for my navigation that I want to update dynamically between pages. <nav ng-include="menuPath"></nav> Here is my app and routing set up var rxApp = ...
0
votes
1answer
25 views

AngularJS adding content to the routing for a back button

.when('/football', { templateUrl : 'assets/pages/football/home.html', controller : 'footballController' }) .when('/football/teams', { templateUrl : 'assets/pages/football/teams.html', ...
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
98 views

Angularjs $scope value updated in second controller not visible in view

I have one html file and a controller assigned via $routeProvider .when('/page/:pageId', { templateUrl: 'xxxx.html', controller: 'PageCtrl' }) and in the ...
0
votes
1answer
32 views

Passing parameters to the route on button click

I am new to AngularJs. I have a search box with a button which hits the route defined in the config of Angular application. <div class="search-block clearfix"> <div class="input-group"> ...
0
votes
1answer
102 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 ...
1
vote
1answer
67 views

Angular JS deep linking will refresh view

I'm going to try my best to explain this problem. I am also new to Angular so bear with me. I have two routes that use the same template... ExampleApp.config(['$routeProvider', ...
0
votes
1answer
57 views

Angularjs initialize $on in other controller?

i have a normal navbar with a menuController, this is the parent. in this menuController is a method 'sendData()' with a broadcast method and a location call "$location.path('/page2')" which ...
0
votes
1answer
64 views

Loading the partial files after the http call inside the controller

I am having a controller and a partial file. The partial file tries to access a variable which was set by the controller. But the issue here is that the controller populates the scope object with the ...
1
vote
1answer
137 views

Passing javascript variables from controller to partial file in AngularJs

I am new to AngularJs. I have put a url value in the scope variable inside a controller. This value should be used in the partial file corresponding to the controller inside a javascript function. How ...
0
votes
1answer
75 views

Set radio button state based on a value received from REST in AngularJS

What I would like to achieve is set a radio button's state according to the data retrieved from the server in AngularJS. What makes this more special is that I need to show a div based on a condition ...
0
votes
4answers
216 views

angularjs maintain the scope variable across routes

How do I maintain the model across routes. for eg I have a list of profiles loaded onto the home page. The home page also contains a "load more" action to load more profiles, basically pushing data to ...
0
votes
1answer
44 views

Resolve in router is not updating scope in time

Hello there, I have issue with manipulating with scope variables (with resolve in router) before angular view content is renderer. I am using AngularJS 1.2.16 I have view, where is DIV displayed ...
1
vote
2answers
60 views

AngularJS: Recommendation on rendering different view when HTTP 404

What I am doing I am trying to create a service which loads the user budgets for current month. The code looks like $scope.thisMonthBudgetSummary = function () { console.log('retrieving ...
1
vote
1answer
60 views

AngularJS $location not updated properly when using $routeProvider

I have an Angular JS application with a defaultController which controls the header of the app. Then I have some other controllers one for each view. The views are loaded in the <main>. I load ...
0
votes
0answers
34 views

AngularJS remembering page scroll location

I have multiple pages of data that lists publications by author. The first page lists all the publications and has infinity-scrolling implemented. Another page allows you to filter by author, and ...
1
vote
1answer
240 views

Angularjs adding $scope.$watch after $routeProvider's resolve

I'm having an issue where I am trying to watch a certain element from my scope after the resolve is done. For some reason, it gets run when i run the second line from this snippet and I dont seem to ...
0
votes
1answer
402 views

AngularJs route.reload(); infinite loops

i'm a newbie in AngularJS, i got some Jsonp files witch they're generated by drupal. My problem come when i'm trying to show the informations of my articles on my view. <!-- Script JS --> ...
0
votes
1answer
133 views

AngularJS viewContentLoaded not executing on page refresh and initial load while using directive

I am experiencing some inconsistencies when using a custom directive and relying on the viewContentLoaded event to run... Below is a "bare-bones" version of the problem: var myApp = ...
0
votes
3answers
43 views

Keeping track of whether a user has edited a form

I am loading a form with customer data in it. When a user edits the customer data, I want to be able to track the changes so that if a user changes url, I can pop up an alert to ask the user whether ...
0
votes
2answers
105 views

My SPA does not load in AngularJS using Routing

I have just started getting into AngularJS and was following the guide AngularJS in 60 Minutes by Dan Wahlin up to page 79. However, I’m only presented with my homepage which is blank by default; it ...
0
votes
1answer
101 views

Changing routes doesn't refresh data, gives ng:areq error

In my AngularJS app, I have a route that looks like: .when('/:project/:page', { templateUrl: '/ui-editor/editor', controller: 'EditorCtrl' }) In a view, I have a link that looks like: ...
0
votes
1answer
1k views

Authentication in passport.js , used with angular js

I came to know the use of authenticate method in passport.js from the below link http://passportjs.org/guide/authenticate/ In my project I have the below code: app.post('/login', function(req, res, ...
0
votes
1answer
210 views

view model(scope) not binding to the view(html) when routing using angularjs ngRoute

Here is my Index.cshtml, and I have 3 controllers. The MainController, View1Controller and View2Controller. <!DOCTYPE html> <html> <head> <script ...
0
votes
0answers
54 views

Problems with returning to a previous rendered view in angularjs

I am having issues with something which might imply I am missing something conceptual. I am using a view with a controller which populates from a couple of different services(asynchronous). ...
2
votes
1answer
1k views

method overloading \ overriding in AngularJS

I have a scenario, i which I have a share button, I have a container controller, called metaCtrl, which is on the html tag. And also inner controllers. I have a share button, that calls the ...
0
votes
1answer
591 views

Sharing a webservice's data across controllers in AngularJS

I have 2 big issues with an Angular app, I'm completely stuck and hoping someone out there can help me. My method of sharing data from a web-service out to multiple controllers is flawed and I don't ...
1
vote
1answer
605 views

.config .run and 2 x config, where to put changeroute .. appctrl, config, run or what?

I wanted to find out the different to .config and .run functions in angularjs. I was using my .config for setting up routes of course but i did have some $on for watching route change starts and ...
1
vote
2answers
104 views

AngularJS partials with URLs in directives - best practice?

I quite like how angular-ui has created ui-routes, which provides named routes (among other things). Though likely a simple directive to write—a wrapper for ui-view—I am not sure if it is best ...
4
votes
2answers
4k views

AngularJS: Resolving not in RouteProvider but in Controller?

I saw some sample code here Delaying AngularJS route change until model loaded to prevent flicker And straight away I though this was the right way to go, I need to have my controller LOAD only when ...
0
votes
1answer
383 views

ngController method called twice

I've got an angularjs app with a nav bar inside my index.html page like that : <div class="navbar navbar-inverse navbar-fixed-top" ng-controller="NavCtrl"> <div ...
0
votes
2answers
188 views

How to set a model for a single view in Angular JS?

I've got a controller in Angular JS. In this controller i've got a $scope.users property : it's an array of users. This controller is used by two views: /users and /users/:id. I've seen that the ...
3
votes
2answers
336 views

Single page app, permalinks and ngView?

This is my current setup, with each column being represented by a controller: <navbar></navbar> [column1] [column2] [column3] <footer></footer> Additionally each column has ...
2
votes
1answer
2k views

angularjs Directive not reacting to attribute change

I have a chat directive that I use to place a chatroom in on the page. mod.directive('chat', function () { return { templateUrl: '/chat', replace: true, scope: { chatID:'@chat', ...
1
vote
1answer
2k views

AngularJS: service query returning zero result

my app.js looks like var app = angular.module('pennytracker', [ '$strap.directives', 'ngCookies', 'categoryServices' ]); app.config(function($routeProvider) { console.log('configuring ...
1
vote
1answer
355 views

AngularJS memory leak with ng-switch? Can someone solve this?

I've built a custom routing method for angularjs and I use this to control ng-switch within my app in order to create multi level deep linking. http://plnkr.co/edit/beAm3WRomMafKzx1SoSZ?p=preview ...
5
votes
4answers
13k views

AngularJS: Multiple views with routing without losing scope

I'm trying to implement a classic list/details UI. When clicking an item in the list, I want to display an edit form for that item while still displaying the list. I'm trying to work around Angular's ...
0
votes
1answer
761 views

How to show one item from array in angularjs?

So im writting front-end for one simple app, and im stuck on one thing. There is a news list page which should take user to single news page. All news are in one array, which is sitting in the news ...