Using AngularJs in Worklight/PhoneGap application

Angular.js is a JavaScript MVC framework, that makes development of HTML applications easy. I wanted to figure out how to use it for developing Worklight application so i followed these steps to build simple Hello AngularJs application
  • First create a WorkLight application using WorkLight wizard, make sure that it works
  • Next make changes in the index.html or entry page of your application to include angular.js from Google CDN and also add <p>Hello {{'World'.length}}</p>
  • to test if AngularJs template is working
    
    <!DOCTYPE HTML>
    <html>
    <head>
     <meta charset="UTF-8">
     <title>HelloWorld</title>
     <meta name="viewport" content="width=device-width, 
    initial-scale=1.0, maximum-scale=1.0, 
    minimum-scale=1.0, user-scalable=0">
     <link rel="shortcut icon" href="images/favicon.png">
     <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
     <link rel="stylesheet" href="css/HelloWorld.css">
     <script>window.$ = window.jQuery = WLJQ;</script>
    </head>
    <body id="content" style="display: none;" ng-app>
     <h1>Hello Angularjs</h1> 
     <p>Hello {{'World'.length}}</p>
     <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js" />
     <script src="js/initOptions.js"></script>
     <script src="js/HelloWorld.js"></script>
     <script src="js/messages.js"></script>
    </body>
    </html
    
After deployment you will notice that it prints Hello + length of 'world' which is 5 characters like this

203 comments:

«Oldest   ‹Older   201 – 203 of 203
codingpromasters said...

your blog is very nice....
Digital marketing is among the trending courses most students and working professionals want to learn, and the reason is enormous demand and a bright future ahead.
appian training in Hyderabad

codingpromasters said...

your blog is very nice.....

Appian is a low coding platform BPM (Business Process Management) tool that allows users and organizations to build the app by simple drag-and-drop options and helps automate complex business processes efficiently.

We at Coding Pro Masters provide the best Appian training to our students through our certified BPM trainers who have 7+ years of industry experience, real-time understanding of BPM apps, and have worked for multiple companies on Appian development.
appian cource in Hyderabad

GCPMASTERS said...

thanks for valuable info
gcp training in hyderabad

«Oldest ‹Older   201 – 203 of 203   Newer› Newest»