<!DOCTYPE html>
<html>
    <head>
        <title>Wikitechy AngularJS Tutorials</title>
        <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"> </script>
    </head>
    <body>
        <div ng-app="myApp" ng-controller="selectCtrl">        
            <h2>ng-if Directive in AngularJS Tutorials</h2>                    
            <select ng-model="name" ng-options="x for x in tech"></select>
            <h5 ng-if="name == 'HTML'">
                Welcome to HTML Tutorials
            </h5>
            <h5 ng-if="name == 'AngularJS'">
                Welcome to AngularJS Tutorials
            </h5>
            <h5 ng-if="name == 'CSS'">
                Welcome to CSS Tutorials
            </h5>
        </div>
        <script>
            var app = angular.module("myApp", []);
            app.controller("selectCtrl", function($scope) {
                $scope.tech = ["HTML","AngularJS","CSS"];
            });
        
</script>         
    </body>
</html>



 


www.wikitechy.com © Copyright 2016. All Rights Reserved.