1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-29 01:21:53 +00:00

update search behavior

This commit is contained in:
Rokt33r
2015-06-10 16:10:22 +09:00
parent 29430b540b
commit 8e7109161a
6 changed files with 23 additions and 8 deletions

View File

@@ -11,7 +11,7 @@ angular.module('codexen')
callSign: vm.callSign,
mode: vm.mode == null ? null : vm.mode.toLowerCase(),
content: vm.content,
tags: angular.isArray(vm.Tags) ? vm.Tags.map(function (tag) { return tag.name }) : []
Tags: angular.isArray(vm.Tags) ? vm.Tags.map(function (tag) { return tag.name }) : []
}
Snippet.create(params)

View File

@@ -1,10 +1,17 @@
/* global angular */
angular.module('codexen')
.controller('SnippetsListController', function ($auth, Snippet, $scope, $state) {
.controller('SnippetsListController', function ($auth, Snippet, $scope, $state, $scope) {
var vm = this
vm.isLoaded = false
vm.search = $state.params.search
vm.snippetId = parseInt($state.params.id)
$scope.$on('$stateChangeStart', function (e, toState, toParams) {
vm.snippetId = parseInt(toParams.id)
})
var loadSnippets = function () {
if ($auth.isAuthenticated) {
Snippet.findMine({