Class: ShareService

gmf.ShareService

new ShareService($http, gmfShortenerCreateUrl)

Service to handle the sharing of the permalink.

Parameters:
Name Type Description
$http angular.$http

Angular http service.

gmfShortenerCreateUrl string

URL for the shortener API

Members

(static, constant) URL_MAX_LEN: number

Max length defined for the complete url. Check IE limits, see http://support.microsoft.com/kb/208427

(static, constant) URL_PATH_MAX_LEN: number

Max length defined for the url parth section. Check IE limits, see http://support.microsoft.com/kb/208427

Methods

getShortUrl(url)

Get a short URL of the permalink by calling the url shortener service.

  • If no shortener API url have been specified, it returns the permalink itself.
Parameters:
Name Type Description
url string

the permalink

Returns:
gmfx.ShortenerAPIResponse|angular.$http.HttpPromise

an object containing the permalink not shortened or the promise attached to the shortener API request

sendShortUrl(shortUrl, email, [opt_message]opt)

Send the short permalink to the email provided

  • If email is provided, the short permalink will be sent to this email
Parameters:
Name Type Attributes Description
shortUrl string

the short permalink to send

email string

the email to which the short url must be send

[opt_message] string= <optional>

message for the email

Returns:
angular.$http.HttpPromise

the promise attached to the shortener API request