forked from Archives/Athou_commafeed
fetch feed name
This commit is contained in:
@@ -1,5 +1,16 @@
|
||||
var module = angular.module('commafeed.directives', []);
|
||||
|
||||
app.directive('ngBlur', function() {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function(scope, elm, attrs) {
|
||||
elm.bind('blur', function() {
|
||||
scope.$apply(attrs.ngBlur);
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
module.directive('scrollTo', function() {
|
||||
return {
|
||||
restrict : 'A',
|
||||
@@ -46,6 +57,19 @@ module.directive('subscribe', function(SubscriptionService) {
|
||||
$scope.close = function() {
|
||||
$scope.isOpen = false;
|
||||
};
|
||||
|
||||
|
||||
$scope.urlChanged = function() {
|
||||
if ($scope.sub.url && !$scope.sub.title) {
|
||||
$scope.sub.title = 'Loading';
|
||||
SubscriptionService.fetch({
|
||||
url : $scope.sub.url
|
||||
}, function(data) {
|
||||
console.log(data)
|
||||
$scope.sub.title = data.title;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.save = function() {
|
||||
SubscriptionService.subscribe($scope.sub);
|
||||
|
||||
@@ -21,6 +21,12 @@ module.factory('SubscriptionService', [
|
||||
return array;
|
||||
}
|
||||
var actions = {
|
||||
fetch : {
|
||||
method : 'GET',
|
||||
params : {
|
||||
_method : 'fetch'
|
||||
}
|
||||
},
|
||||
get : {
|
||||
method : 'GET',
|
||||
params : {
|
||||
@@ -58,6 +64,7 @@ module.factory('SubscriptionService', [
|
||||
callback(data);
|
||||
});
|
||||
};
|
||||
s.fetch = res.fetch;
|
||||
s.subscribe = function(sub, callback) {
|
||||
res.subscribe(sub, function(data) {
|
||||
s.init();
|
||||
|
||||
Reference in New Issue
Block a user