SoFunction
Updated on 2025-04-13

Discussing simple applications in AngularJs

html page code

<body ng-app="myApp">
<div ui-view></div>
<div ui-view="login"></div>
<div ui-view="enroll"></div>
</body>

Files that need to be referenced

<script src=""></script>

Inject UI-Router as a dependency for web applications into the main program:

url: The url option will specify a URL for the status of the application based on the status where the user browses the application (the link is displayed on the address). This way, the effect of deep linking can be achieved when browsing the application.

var myApp = ('myApp', ['']);
(['$stateProvider', '$urlRouterProvider', routeConfig]);
function routeConfig($stateProvider, $urlRouterProvider) {
$('');
$('competition', {
url: '/competition',
templateUrl: '/',
controller: 'competitionController'
}).state('', {
url: '/competition-detail',
templateUrl: '/',
controller: 'competitionDetailController'
}).state.('',{
url: '/',
templateUrl: '',
controller: 'enrollFromController'
}).state.('',{
url: '/competition-comments',
templateUrl: '',
controller: 'commentsController'
}).state('',{
url: '/competition-login',
views: {
'login@': {
templateUrl: '',
controller: 'loginController'
}
}
}).state('',{<br> url: '/competition-enroll',<br> views: {<br> 'enroll@': {<br><em ><em ><em ><em ><em >  templateUrl: '',<br></em></em></em></em></em><em ><em ><em ><em ><em ><em >controller: 'enrollController'<br></em></em></em></em></em></em><em ><em ><em ><em ><em ><em ><em > }<br></em></em></em></em></em></em></em><em ><em ><em ><em ><em ><em ><em ><em > }<br></em></em></em></em></em></em></em></em><em ><em ><em ><em ><em ><em ><em ><em ><em > })<br></em></em></em></em></em></em></em></em></em><em >}</em>

It should be noted that: $stateProvider is used, and ngRoute is used to use $routeProvider.

$

$(to, [,toParams],[,options])

The formal parameter to is of a string type, and must use "^" or "." to represent the relative path;

The formal parameter toParams is nullable, and the type is an object;

The formal parameters options can be null, the type is an object, and the fields include: location is the bool type is the default true, inherit is the bool type is the default true, and relative is the object.

$state.$current, notify is the default to true for bool type, reload is the default to false for bool type

$('')

$('^') to the previous level, such as from to photo

$('^.list') to adjacent state, such as from

$('^.') to grandchildren-level state, such as from

The above is a simple application in AngularJs introduced to you by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support for my website!