angularjs-ng-route

angularjs 1.6.0 (latest now) routes not working

不想你离开。 提交于 2020-01-08 08:50:09
问题 I was expecting to see this question on Stackoverflow but didn't. Apparently I'm the only one having this problem that seems to me to be very common. I have a basic project I am working on but the routes don't seem to work even though everything I've done so far seems to be right. I have this piece of html in my index.html file: <html> <head ng-app="myApp"> <title>New project</title> <script src="https://code.angularjs.org/1.6.0/angular.min.js"></script> <script src="https://code.angularjs

Angular ng-view or ng-include not working

馋奶兔 提交于 2020-01-07 08:25:08
问题 I've been working on one of the courses on Coursera for learning full stack web development (preview ver), and have been facing some troubles with ng-view and ng-controller. I don't get any errors when I open my websites but ng-view or ng-controller seems to not change the views on my website. This is my index page: <html lang="en" ng-app="confusionApp"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width,

Minification issue on route config angular js & typescript min safe

大城市里の小女人 提交于 2020-01-07 03:52:26
问题 I have a bundle with several js files (generated by typescript files) When I use minification on the bundle, the page fails. The error on chrome console: Uncaught Error: [$injector:modulerr] Failed to instantiate module AppModule due to: Error: [$injector:unpr] Unknown provider: n I isolated the problem to one of two files, the app.module and the app.routes as follows: app.module: ((): void=> { var app = angular.module("AppModule", ['ngRoute', 'ngMessages', 'app.xxx.xxx.xxxModule',

Using ngRoute with 'controller as' syntax in angularJS

那年仲夏 提交于 2020-01-07 03:24:08
问题 I have the following config and controllers .config(function($routeProvider){ $routeProvider .when('/', { templateUrl: 'page-home.html', controller: 'homeController', controllerAs: 'hctrl' }) .when('/about', { templateUrl: 'page-about.html', controller: 'aboutController', controllerAs: 'actrl' }) .when('/contact', { templateUrl: 'page-contact.html', controller: 'contactController', controllerAs: 'cctrl' }); }) .controller('homeController', function(){ this.pageClass = 'page-home' })

Using Django template inheritance with ngroute - where does `<div ng-view>` go if I want to override blocks outside of `<div ng-view>`?

孤街醉人 提交于 2020-01-04 06:55:26
问题 This is my base.html : <!DOCTYPE html> <html{% block html %}{% endblock%}> {% load static from staticfiles %} <head> <meta charset="utf-8"> <title>{% block title %}Base{% endblock %}</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <script src="{% static 'js/jquery-1.11.3.min.js' %}"></script> <script src="{% static 'js/angular.js' %}"></script> <script src="{% static 'js/angular-route.js' %}"></script> <base href="/"> {% block head %}{% endblock %} </head>

AngularJs - routing between css files

谁说胖子不能爱 提交于 2019-12-25 06:27:49
问题 ​Hi all.. referring to ngRoute, i created a single page application but would like to apply different css rules to each sub-page like background image how can i do that? i assigned a different controller to each sub-page and in the link tag i used ng-href and {{name}}.css to tell the browser to grap the correct css file where is name is giving the value of the file name and attached to the scope inside the corresponding controller. is there a need to use more than one ng-controller ? here is

Routing Demo stops working when updated to AngularJS 1.6

眉间皱痕 提交于 2019-12-25 03:16:31
问题 When I updated the code snippet from this answer to use AngularJS 1.6, it stopped working. The Login and Register links no longer change the view. The DEMO var app = angular.module("myApp", ["ngRoute"]) app.config(function($routeProvider) { $routeProvider.when('/', { template: `<h1>Login</h1>`, controller: 'loginCtrl' }) .when('/register', { template: `<h1>Register</h1>`, controller: 'RegisterCtrl' }) .otherwise({ redirectTo: '/' }); }); app.controller('loginCtrl', function($scope) { $scope

Using Angular route in webapi application

假装没事ソ 提交于 2019-12-23 12:54:13
问题 I'm not sure how can I implement proper Angular routing in web api application. I'm able to open the pages using this approach: http://localhost:52876/HTML/app/borrower.html The Angular controller loads fine and all functionality is there from the angular side. Now, I want to be able to open the views in a bit better view, using ng-route, so for example http://localhost:52876/HTML/app/borrower.html will become http://localhost:52876/borrower. I included the ng-route.js file in the html files

Login Page without Index.html Design - ngRoute (AngularJS)

*爱你&永不变心* 提交于 2019-12-21 02:47:58
问题 I'm using ngRoute to do the routing of my AngularJS application (myApp) but I have a problem: I don't know how to NOT APPLY my index.html design (with all my sidebars) to my login.html page, which seems to be applied by default if it is defined as a view. I want a simple design for my login.html page: only two fields to fill out, without the design of my index.html , which is applied to all the views in myApp. Thereby, I don't know how to do my routing to accomplish such task. Thank you very

AngularJS routing 404 error with HTML5 mode

て烟熏妆下的殇ゞ 提交于 2019-12-16 22:29:23
问题 I just got started with angular js , i tried routing and worked pretty well .The problem is when i refresh the page it is showing 404 error since it is checking in my actual directory rather than checking in routes. here is the complete code <!DOCTYPE html> <html> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-route.js"></script> <body ng-app="myApp"> <base href="/" /> <a