Failed to instantiate module [$injector:unpr] Unknown provider: $routeProvider

The ngRoute module is no longer part of the core angular.js file. If you are continuing to use $routeProvider then you will now need to include angular-route.js in your HTML: <script src=”https://stackoverflow.com/questions/18481863/angular.js”> <script src=”angular-route.js”> API Reference You also have to add ngRoute as a dependency for your application: var app = angular.module(‘MyApp’, [‘ngRoute’, …]); If … Read more

Angular 2 router no base href set

https://angular.io/docs/ts/latest/guide/router.html Add the base element just after the <head> tag. If the app folder is the application root, as it is for our application, set the href value exactly as shown here. The <base href=”https://stackoverflow.com/”> tells the Angular router what is the static part of the URL. The router then only modifies the remaining part … Read more

Is it possible to make an ASP.NET MVC route based on a subdomain?

You can do it by creating a new route and adding it to the routes collection in RegisterRoutes in your global.asax. Below is a very simple example of a custom Route: public class ExampleRoute : RouteBase { public override RouteData GetRouteData(HttpContextBase httpContext) { var url = httpContext.Request.Headers[“HOST”]; var index = url.IndexOf(“.”); if (index < 0) … Read more

How/when to use ng-click to call a route?

Routes monitor the $location service and respond to changes in URL (typically through the hash). To “activate” a route, you simply change the URL. The easiest way to do that is with anchor tags. <a href=”#/home”>Go Home</a> <a href=”#/about”>Go to About</a> Nothing more complicated is needed. If, however, you must do this from code, the … Read more

No route matches “/users/sign_out” devise rails 3

I think the route for signing out is a DELETE method. This means that your sign out link needs to look like this: <%= link_to “Sign out”, destroy_user_session_path, :method => :delete %> Yours doesn’t include the :method => :delete part. Also, please note that for this to work you must also include <%= javascript_include_tag :defaults … Read more

How to detect a route change in Angular?

In Angular 2 you can subscribe (Rx event) to a Router instance. So you can do things like class MyClass { constructor(private router: Router) { router.subscribe((val) => /*whatever*/) } } Edit (since rc.1) class MyClass { constructor(private router: Router) { router.changes.subscribe((val) => /*whatever*/) } } Edit 2 (since 2.0.0) see also : Router.events doc class … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)