fetch feed name

This commit is contained in:
Athou
2013-03-30 20:51:51 +01:00
parent d8b8f6617a
commit 5a4d11c4de
8 changed files with 75 additions and 6 deletions

View File

@@ -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);