Part 4 - Controllers in AngularJS

preview_player
Показать описание
► CLICK TO DOWNLOAD COMPLETE SOURCE CODE -
***********************************************
Do Watch Video in High Quality ...
***********************************************
Рекомендации по теме
Комментарии
Автор

The code does not work.
I get the error [$controller:ctrlreg] The controller with the name 'citiController' is not registered.
You need to fine function like bellow in order to make it work:
<script>
var application = angular.module('myapp', [])
application.controller('citiController', ['$scope', function($scope){
$scope.cities = [{city:'Indore', state:'Madhya Pradesh'},
{city:'Bangalore', state:'Karanatka'},
{city:'Hyderabad', state:'Andhra Pradesh'}];
}]);
</script>

OR put the code in the script tags in javascript file say citicontroller.js (without script tags) and include the file with folder as bellow:
<script

AshishGuptai
welcome to shbcf.ru