Search code examples
angularjstizentizen-web-app

Tizen Web app Angular JS tutorial


i am searching Angular JS tutorial in tizen site, samsung site and off course from google. but sadly i have not got any direction how to build a web app using Angular JS. i have found only this https://developer.tizen.org/ko/community/tip-tech/introduction-angular-2-tizen but this is not showing any idea on tizen. please help.


Solution

  • Step 1: Add angular.min.js and a js controller to your project. enter image description here

    Step 2: Add the library and controller path to the index.html

    <script src="js/angular.min.js"></script>
    <script src="js/demoController.js"></script>
    

    Step 3: Add these in html

    <html data-ng-app="myApp">
    

    And

    <body data-ng-controller="myCtrl">
    

    Step 4: Write your own code in controller,

    For example,

    var app = angular.module('myApp', []);
    app.controller('myCtrl', function($scope) {
        $scope.CountryList = [
    
                              {
                                  "code": "1", 
                                  "Name" : "South Korea"
    
                              },
                              {
                                  "code": "2", 
                                  "Name" : "India"
    
                              },
                              {
                                  "code": "3", 
                                  "Name" : "Bangladesh"
    
                              },
                              {
                                  "code": "4", 
                                  "Name" : "Russia"
    
                              }
    
                              ];
    });
    

    Step 5: Write your own code in html,

    For example,

    <ul class="ui-listview">
        <li class="ui-li-static" data-ng-repeat="country in CountryList">
            {{country.Name}}
        </li>   
    </ul>
    

    View:

    enter image description here