Home >Web Front-end >JS Tutorial >Simple example of ionic
1. Example background
ionic is based on AngularJS and is a framework. According to AngularJS two-way binding variables, dynamically obtain values.
2. Implementation source code
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <title>ionic之简单实例</title> <link rel="stylesheet" href="../css/ionic.css" /> <script type="text/javascript" src="../js/ionic.bundle.js" ></script> <script> var app = angular.module("tagApp",["ionic"]); app.controller("tagController",function($scope){ $scope.username = "李海"; }); </script> </head> <body ng-app="tagApp" ng-controller="tagController"> <ion-header-bar class="bar-positive"> <label class="title">欢迎使用ionic</label> </ion-header-bar> <ion-content> <span>{{username}}</span> </ion-content> </body> </html>
3. Implementation results
# The above is the content of a simple example of ionic. For more related content, please pay attention to the PHP Chinese website ( www.php.cn)!