Permalink
Browse files

The Basics

  • Loading branch information...
mraible committed Jan 29, 2015
1 parent de30ee9 commit 9792a0fbf1c2a5f1171498de7666e6f13cdd0537
Showing with 21 additions and 1 deletion.
  1. +2 −1 app/app.js
  2. +2 −0 app/index.html
  3. +4 −0 app/search/index.html
  4. +13 −0 app/search/search.js
View
@@ -5,7 +5,8 @@ angular.module('myApp', [
'ngRoute',
'myApp.view1',
'myApp.view2',
- 'myApp.version'
+ 'myApp.version',
+ 'myApp.search'
]).
config(['$routeProvider', function($routeProvider) {
$routeProvider.otherwise({redirectTo: '/view1'});
View
@@ -18,6 +18,7 @@
<ul class="menu">
<li><a href="#/view1">view1</a></li>
<li><a href="#/view2">view2</a></li>
+ <li><a href="#/search">search</a></li>
</ul>
<!--[if lt IE 7]>
@@ -36,6 +37,7 @@
<script src="app.js"></script>
<script src="view1/view1.js"></script>
<script src="view2/view2.js"></script>
+ <script src="search/search.js"></script>
<script src="components/version/version.js"></script>
<script src="components/version/version-directive.js"></script>
<script src="components/version/interpolate-filter.js"></script>
View
@@ -0,0 +1,4 @@
+<form ng-submit="search()">
+ <input type="search" name="search" ng-model="term">
+ <button>Search</button>
+</form>
View
@@ -0,0 +1,13 @@
+angular.module('myApp.search', ['ngRoute'])
+
+ .config(['$routeProvider', function ($routeProvider) {
+ $routeProvider
+ .when('/search', {
+ templateUrl: 'search/index.html',
+ controller: 'SearchController'
+ })
+ }])
+
+ .controller('SearchController', function () {
+ console.log("In Search Controller...");
+ });

0 comments on commit 9792a0f

Please sign in to comment.