Demo ui-router basic state change

Size
2,042 Kb
Views
30,360

How do I make an demo ui-router basic state change?

What is a demo ui-router basic state change? How do you make a demo ui-router basic state change? This script and codes were developed by Aaron K Saunders on 25 September 2022, Sunday.

Demo ui-router basic state change Previews

Demo ui-router basic state change - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Demo ui-router basic state change</title>
</head>
<body> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> <link href="https://code.ionicframework.com/1.0.0/css/ionic.min.css" rel="stylesheet"> <script src="https://code.ionicframework.com/1.0.0/js/ionic.bundle.js"></script> </head> <body ng-app="app"> <ion-nav-bar class='bar-positive'> <ion-nav-back-button class="button-clear"> <i class="ion-arrow-left-c"></i> Back </ion-nav-back-button> </ion-nav-bar> <ion-nav-view animation="slide-left-right"></ion-nav-view> <script type="text/ng-template" id="home.html"> <ion-view title="Home"> <ion-content class="padding"> <button class="button button-assertive" ui-sref="detail"> Goto State 'detail' </button> <pre class="padding">{{stateInfo | json}}</pre> {{date}} </ion-content> </ion-view> </script> <script type="text/ng-template" id="detail.html"> <ion-view title="Detail"> <ion-content class="padding"> <pre class="padding">{{stateInfo | json}}</pre> {{date}} </ion-content> </ion-view> </script> </body>
</html> <script src="js/index.js"></script>
</body>
</html>

Demo ui-router basic state change - Script Codes JS Codes

myApp = angular.module('app', ['ionic']);
myApp.config(function($stateProvider, $urlRouterProvider) { // // For any unmatched url, redirect to /state1 $urlRouterProvider.otherwise("/home"); // // Now set up the states $stateProvider .state('home', { url: "/home", templateUrl: "home.html", controller :"homeCtrl" }) .state('detail', { url: "/detail", templateUrl: "detail.html", controller :"detailCtrl" });
})
.controller('homeCtrl', function($scope, $state) { $scope.stateInfo = $state.current; $scope.date = new Date();
})
.controller('detailCtrl', function($scope, $state) { $scope.stateInfo = $state.current;
})
Demo ui-router basic state change - Script Codes
Demo ui-router basic state change - Script Codes
Home Page Home
Developer Aaron K Saunders
Username aaronksaunders
Uploaded September 25, 2022
Rating 3
Size 2,042 Kb
Views 30,360
Do you need developer help for Demo ui-router basic state change?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Aaron K Saunders (aaronksaunders) Script Codes
Create amazing video scripts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!