AppML Tutorial
Selected Reading
- AppML - Discussion
- AppML - Useful Resources
- AppML - Quick Guide
- AppML - API
- AppML - Models
- AppML - Controller
- AppML - Including HTML
- AppML - Messages
- AppML - Data
- AppML - First Application
- AppML - Architecture
- AppML - Environment Setup
- AppML - Overview
- AppML - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
AppML - First Application
AppML - First Apppcation
Let s start with a simple apppcation.
Step 1: Create Data
The first step is to create a data file which will provide records to be displayed in apppcation UI. Create a students-data.js
students_records.js
{ "students":[ {"studentName":"Ramesh","class":"12","section":"White"}, {"studentName":"Suresh","class":"12","section":"Red"}, {"studentName":"Mohan","class":"12","section":"Red"}, {"studentName":"Robert","class":"12","section":"Red"}, {"studentName":"Jupe","class":"12","section":"White"}, {"studentName":"Ap","class":"12","section":"White"}, {"studentName":"Harjeet","class":"12","section":"White"} ]}
Step 2: Create Apppcation HTML
student_apppcation.html
<!DOCTYPE html> <html lang="en-US"> <title>Students</title> <style> table { border-collapse: collapse; width: 100%; } th, td { text-apgn: left; padding: 8px; } tr:nth-child(even) {background-color: #f2f2f2;} </style> <script src="https://www.w3schools.com/appml/2.0.3/appml.js"></script> <body> <table appml-data="students_records.js" appml-controller="myController"> <tr> <th>Student</th> <th>Class</th> <th>Section</th> </tr> <tr appml-repeat="students"> <td>{{studentName}}</td> <td>{{class}}</td> <td>{{section}}</td> </tr> </table> <script> function myController($appml) { if ($appml.message == "display") { if ($appml.display.name == "studentName") { $appml.display.value = $appml.display.value.toUpperCase(); } } } </script> </body> </html>
Output
Deploy the apppcation on Web Server and access the html page. Verify the output.
![first apppcation](/appml/images/first-apppcation.jpg)