Categories

Saturday, April 20, 2024
#919814419350 therichposts@gmail.com
AngularjsAngularjs1

Angularjs1 Routing Script With Controller Names

Angularjs1 Routing Script With Controller Names

Hello, welcome to therichpost.com. In this post, I will tell you Angularjs1 Routing Script With Controller Names. Nowadays Angularjs is very popular and known as one page website. I am familiar with Angularjs1 very well but Angularjs2 is totally different with Angularjs1. Angular2 is totally command based.

We can do custom jquery code in angularjs but we should follow the angularjs standard.

Here is working code for Angularjs1 Routing Script With Controller Names and you need to add this script into your js file:

‘use strict’;

angular
.module(‘project’, [‘ngRoute’])
.config(function ($routeProvider) {
$routeProvider
.when(‘/cmap/:id?’, {
templateUrl : ‘views/cmap.html’,
controller : ‘CMapCtrl’,
controllerAs : ‘cmap’
})
.when(‘/importshare’, {
templateUrl : ‘views/import-share.html’,
controller : ‘ImportShareCtrl’,
controllerAs : ‘importshare’
})
.when(‘/settings’, {
templateUrl : ‘views/settings.html’,
controller : ‘SettingCtrl’,
controllerAs : ‘settings’
})
.when(‘/csheduler’, {
templateUrl : ‘views/csheduler.html’,
controller : ‘CSchedulerCtrl’,
controllerAs : ‘csheduler’
})
.otherwise({
redirectTo : ‘/cmap/’
});
});

There are many more in Angularjs and i will let you know all. Please do comment if you any query related to this post. Thank you. Therichpost.com

therichpost
the authortherichpost
Hello to all. Welcome to therichpost.com. Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know WordPress, Core php, Angularjs, Angular 14, Angular 15, Angular 16, Angular 17, Bootstrap 5, Nodejs, Laravel, Codeigniter, Shopify, Squarespace, jQuery, Google Map Api, Vuejs, Reactjs, Big commerce etc.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.