diff --git a/angular/app.js b/angular/app.js new file mode 100644 index 0000000..92667a4 --- /dev/null +++ b/angular/app.js @@ -0,0 +1,22 @@ +angular.module('firstModule', []); + +firstModule.config(function($routeProvider) { + $routj +}) + + +firstModule.config(function($routeProvider) { + $routeProvider + .when('/', + { + templateUrl: 'view1.html', + controller: "FruitController", + controllerAs: "fruitCtrl" + }) + .when('/view2', + { + templateUrl: 'view2.html', + controller: "" + }) + .otherwise({redirectTo: '/'}); +}); diff --git a/angular/fruitController.js b/angular/fruitController.js new file mode 100644 index 0000000..8f052a6 --- /dev/null +++ b/angular/fruitController.js @@ -0,0 +1,7 @@ +angular + .module('firstModule') + .controller('FruitController', function() { + var vm = this; + + vm.fruits = ['Apple', 'Banana', 'Watermelon', 'Peach']; + }); diff --git a/angular/index.html b/angular/index.html index 6debab7..50801e9 100644 --- a/angular/index.html +++ b/angular/index.html @@ -2,31 +2,11 @@ + +
- - \ No newline at end of file + diff --git a/angular/view1.html b/angular/view1.html index ce17a44..3db592c 100644 --- a/angular/view1.html +++ b/angular/view1.html @@ -1,6 +1,6 @@ 
-
\ No newline at end of file +