AngularJS – Views

Via multiple views on a single page the angularjs supports single page application. To do this AngularJS has provided ng-view and ng-template directives and $routeProvider services.

ng-view

ng-view tag simply creates a place holder where a corresponding view (html or ng-template view) can be placed based on the configuration.The ng-view is the directive that angular uses as a container to switch between views. Let’s start by making an empty ng-view tag in our app

Usage


  

ng-template

The ng-template directive is helps to create an html view using script tag. <ng-template> gives you a lot of results relating to the html5 <template> tag.

AngularJS ng-template Directive Syntax

var app = angular.module("AngularApp", ['ngRoute']);
app.config(['$routeProvider', function ($routeProvider)
{
	$routeProvider.when('/test1', { templateUrl: 'test1.html' })
}
]);
app.controller('exampleController', function ($scope) {
	$scope.text = 'Hello';
});

5 thoughts on “AngularJS – Views

  1. 7lmo2

    cheap clomid pills where to get generic clomiphene without prescription where to get generic clomid without dr prescription where buy cheap clomid no prescription buying cheap clomiphene tablets can you get clomid pills cost of cheap clomid without insurance

  2. SnapTik

    An intriguing discussion is worth comment. I do believe that you should publish more on this issue, it might not be a taboo subject but generally folks don’t talk about such topics. To the next! Cheers.

  3. warm blankets

    Hey! Do you know if they make any plugins to help with Search Engine Optimization? I’m trying to get my blog to rank for some targeted keywords but
    I’m not seeing very good results. If you know of any please share.

    Kudos! You can read similar article here: Eco product

  4. eco product

    Howdy! Do you know if they make any plugins to help with SEO?
    I’m trying to get my site to rank for some targeted keywords but I’m
    not seeing very good success. If you know of any please share.
    Cheers! I saw similar art here: Blankets

  5. https://hitman.agency/shop

    Hello there, I found your blog by way of Google at the same time as
    searching for a related matter, your website came up, it appears great.
    I’ve bookmarked it in my google bookmarks.
    Hi there, simply become alert to your blog through Google, and found that it’s really informative.
    I’m gonna watch out for brussels. I will appreciate if you
    happen to proceed this in future. Numerous other folks shall
    be benefited from your writing. Cheers!!

Leave a Reply

Your email address will not be published.