Questions tagged [route-provider]

$routeProvider is a service of module ngRoute that has a simple API, accepting either the when() method which takes a path and hash of options including the templatePath and controller, which matches a pattern and otherwise() method which allows us to redirect to a route if one is not found.

299 questions
4
votes
1 answer

Controller in $routeProvider.when vs ng-controller in template

New to Angular.js. What's the difference of passing the controller as app.config(function($routeProvider, $locationProvider){ $locationProvider.html5Mode(false); $routeProvider .when('/login', {templateUrl:…
uniqrish
  • 1,750
  • 1
  • 11
  • 7
4
votes
0 answers

AngularJS regex in route to restrict some parameters to be int type

I've been looking for a lot of references like: AngularJS regex route for similar url to load different controller and view AngularJS - Route - How to match star (*) as a path These are questions 1-2 years ago. I'm using AngularJS v1.2.16 and I'd…
fenix688
  • 2,435
  • 2
  • 17
  • 23
4
votes
1 answer

AngularJS: $routeProvider when resolve $http returns response obj instead of my obj

I'm trying to resolve a couple ajax calls so that data my controller needs is available before it (and a directive it furnishes) execute. The order of execution is working, however, instead of returning the object I create, the result injected into…
Jakob Jingleheimer
  • 30,952
  • 27
  • 76
  • 126
3
votes
3 answers

Remove route from RouteCollection in Asp.Net Core and add new with same route name (nopCommerce-4.00)

I want to remove existing route from RouteCollection and want to add new route with same route name in nopCommerce 4.00 via plugin Existing route name: //home page routeBuilder.MapLocalizedRoute("HomePage", "", new { controller =…
3
votes
1 answer

Angularjs: Get $routeprovider template from function

I've been reading some important parts of the docs and I found this page: https://docs.angularjs.org/api/ngRoute/provider/$routeProvider Somewhere in there, it says that the route>template property can be either (String|Function). I guess it should…
Peter Esenwa
  • 400
  • 1
  • 4
  • 17
3
votes
0 answers

upon refreshing of the browser, the URLs containing 'hypen' is not going through angular $routeProvider .when(), but directly requesting the server

I am using MEAN Stack, and jade for html templating for developing a project. Since I am using jade all the .when() of the $routeProvider goes through the server and then rendered. Things are absolutely fine until recently I added…
SHRUTHI BHARADWAJ
  • 587
  • 2
  • 5
  • 15
3
votes
1 answer

Multiple url in $routeProvider

I want to redirect multiple url for $routeProvider. How can I apply this? For example, I am trying like this, .when('/laptop' || '/mobile', { templateUrl: '/Selection_Routing/Selection_Product/ProductDetails.html', controller:…
Rubel
  • 71
  • 8
3
votes
3 answers

AngularJS routeProvider doesn't work

I have a problem when I try to use the $routeProvider. It just doesn't work at all and I don't see any problems : var app = angular.module('app', ['ngStorage','ngRoute']); app.config(['$routeProvider', function($routeProvider) { $routeProvider …
Alexandre Couret
  • 354
  • 1
  • 3
  • 16
3
votes
2 answers

Angular JS : $routeProvider with dynamic url

I have a menu that show different groups Name to which a user belongs . I prepared a template page so that when a user choose one of the menu's GROUPS , the template's fields change.
  • Yuri
    • 447
    • 3
    • 9
    • 19
  • 3
    votes
    1 answer

    Incomplete View Loading Before Firebase GetRecord is Resolved

    I'm having a problem loading a record from firebase into my view when directly linking to the intended route with the key as a routeParam. As shown below in my routeProvider I've specified the param later called in the SpecController. The problem…
    ThatTechGuy
    • 879
    • 1
    • 10
    • 29
    3
    votes
    2 answers

    Receive JSON post

    I am using $routeProvider to set a route like when('/grab/:param1/:param2', { controller: 'someController', templateUrl: "templates/someTemplate.html", }). Then in the someController I can read the parameters with $routeParams.param1. How…
    stilllife
    • 1,776
    • 1
    • 18
    • 38
    3
    votes
    3 answers

    Dynamic routeProvider parameters for angular router

    I am trying to take advantage of the back button's history, and so I am using the traditional $routeProvider and a url of .../arg1/something/arg2/something,else/arg3/another/arg4/yet,another/arg5/final However, if one argument is missing, the…
    chris Frisina
    • 19,086
    • 22
    • 87
    • 167
    3
    votes
    1 answer

    Angularjs Retrieving param from routeProvider

    Quick question, is it possible to get a param from a $routeProvider at the below stage? app.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) { $routeProvider .when('/', { templateUrl:…
    myguy1221
    • 261
    • 1
    • 5
    • 14
    3
    votes
    0 answers

    Handling 302 status code in angularjs

    In my app, I have an authentication mechanism that uses 302 to redirect the user to a login view. The client side is in angularjs. It uses $routeProvider to map urls to views. Now, when I click on a link (that is bound to a view in the route…
    jfu
    • 1,700
    • 1
    • 22
    • 31
    3
    votes
    1 answer

    AngularJS - Templates not working

    I am using Restangular to create a simple API using MEAN stack. Here is my code: index.html
    aBhijit
    • 5,261
    • 10
    • 36
    • 56
    1
    2
    3
    19 20