An object is a block of code that has been allocated or configured according to your custom logic.
A program may create many objects of the same class.
In AngularJs, A controller class can contains many object like module object, array module etc.
In the below example, I am going to share the how to Inject the objects and use of objects. Please see the detail as given below.
In AngularJs, A controller class can contains many object like module object, array module etc.
In the below example, I am going to share the how to Inject the objects and use of objects. Please see the detail as given below.
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>injected to Angular objects </title> <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.6/angular.min.js"></script> <script> var app = angular.module('diApp', []); app.controller('diCtrl', ['$scope', '$http', function ($scope, $http) { $scope.countries = [{ "name": "India" }, { "name": "USA" }, { "name": "Nepal" }, { "name": "Indonesia" }, { "name": "Brasil" }]; }]); </script> </head> <body ng-app="diApp" ng-controller="diCtrl"> <div> <div> <div> <h2>Country List</h2> </div> </div> <div ng-repeat="country in countries"> <div> {{country.name}}</div> </div> </div> </body> </html>
Blogger Comment
Facebook Comment