Last active
August 29, 2015 14:26
-
-
Save renesansz/6e52fd4098771eb9d92d to your computer and use it in GitHub Desktop.
Sample Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .state('app.search', { | |
| cache: false, | |
| url: 'search?postal_code', | |
| views: { | |
| navContent: { | |
| templateUrl: NG_PATH.MODULES + 'search/view.html', | |
| controller: 'SearchController as vm' | |
| } | |
| } | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Search Branch | |
| * | |
| * @param {Boolean} useLocation - Search using current location? | |
| */ | |
| function SearchBranch(useLocation) { | |
| if (useLocation) | |
| $state.go('app.search'); | |
| else | |
| $state.go('app.search', { postal_code: vm.postalCode }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <form class="form-location" ng-submit="vm.SearchBranch()"> | |
| <div class="form-group"> | |
| <div class="row"> | |
| <div class="col col-67"> | |
| <input type="text" class="white-text input-text search-postcode" ng-model="vm.postalCode" placeholder="Enter postcode" required> | |
| </div> | |
| <div class="col"> | |
| <button class="button button-block button-light" type="submit">Go</button> | |
| </div> | |
| </div> | |
| </div> | |
| </form> | |
| <button class="button button-block button-icon-top button-energized button-large submit-location" ng-click="vm.SearchBranch(true)"><span class="icon icon-marker-white"></span>Use current Location</button> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment