Sunday, 23 April 2017

AngularJS-13 : Apply CSS

AngularJS-13 : Apply CSS










angular.min.js
-------------------------------------


myCSS.css
------------------------------------



body {
    font-family: Arial;
}

table {
    border-collapse: collapse;
}

td {
    border: 1px solid black;
    padding: 5px;
}

th {
    border: 1px solid black;
    padding: 5px;
    text-align: left;
}



Script.js
------------------------------------
/// <reference path="angular.min.js" />

var myAppModule = angular.module("myAppModule",[]).controller("myDataController",function ($scope) {
        var employees =
            [
                {
                    firstName : "pavan",
                    lastName : "kumar",
                    gender : "Male",
                    city : "Bangalore"
                },
                {
                    firstName : "ram",
                    lastName : "kumar",
                    gender : "Male",
                    city : "Mysore"
                }
            ]
    $scope.employees = employees;
});




myHTML.html
---------------------------------------
<!DOCTYPE html>
<html ng-app="myAppModule">
    <head>
        <script type="text/javascript" src="resources/js/angular.min.js"></script>
        <script type="text/javascript" src="resources/js/Script.js"></script>
        <link type="text/css" rel="stylesheet" href="resources/myCSS.css"/>
    </head>
    <body ng-controller="myDataController">
        <table>
            <thead>
                <tr>
                    <th>First Name </th>
                    <th>Last Name</th>
                     <th>Gender</th>
                     <th>City</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="emp in employees">
                    <td>{{emp.firstName}}</td>
                    <td>{{emp.lastName}}</td>
                    <td>{{emp.gender}}</td>
                    <td>{{emp.city}}</td>
                </tr>
            </tbody>
        </table>
       
   
    </body>
</html>
















No comments:

Post a Comment

AngularJS-24 : Router

AngularJS-24 : Router https://www.youtube.com/watch?v=hThmoKA9aeU#t=427.383649 Download "angular-route.min.js"and add to p...