I still don't see it.
If meta.name is empty, the following code:
<meta ng-attr-name="{{ meta.name }}" ng-attr-property="{{ meta.property }}"
ng-attr-http-equiv="{{ meta['http-equiv'] }}" ng-attr-content="{{
meta.content }}" ng-attr-charset="{{ meta.charset }}" ng-attr-data-ng-repeat
="meta in metas">
will output <meta name=""
that is, an empty value for *name*, won't it?
On Friday, October 3, 2014 4:43:24 PM UTC-3, Christopher O'Donnell wrote:
>
> you're right, i had solved the issue only for the 'http-equiv' vs 'name'=20
> tags. Did not take property into account. It's been updated:
> http://pastebin.com/hBp7yxGJ (line 111)
>
> So basically anywhere in your app you can run something like this:
>
> MetaService.set([
> {title: 'Heres a title'},
> {name: 'description', content: 'Description'},
> {canonical: 'http://....'},
> {rel: 'image_src', href: '/path/to/image'},
> {property: 'og:title', content: 'title'},
> {property: 'og:description', content: 'Description'},
> {property: 'og:image', content: '/path/to/image'},
> {property: 'og:url', content: url}
> ]);
>
>
>
> and in your head:
>
> <meta ng-attr-name=3D"{{ meta.name }}" ng-attr-property=3D"{{ meta.property=
> }}"=20 ng-attr-http-equiv=3D"{{ meta['http-equiv'] }}"
> ng-attr-content=3D"{{=20 meta.content }}" ng-attr-charset=3D"{{ meta.charset
> }}" ng-attr-data-ng-rep= eat =3D"meta in metas">
>
>
> On Friday, October 3, 2014 2:30:46 PM UTC-4, Joberto Diniz wrote:
>>
>> "It solves your issues regarding using the proper name attributes, etc. "
>>
>>
>> Well, I don't see it.
>> My issue is that sometimes I need to set *"name"* and not *"property"*
>> and sometimes I need to set *"property"* and not *"name"*. I don't see
>> your code fixing that.
>>
>> On Friday, October 3, 2014 3:18:34 PM UTC-3, Christopher O'Donnell wrote:
>>>
>>> Hey, I've actually wrote a service for this. It's very new, I wrote it
>>> for a project I am working on now, and wrote it quickly so it could
>>> definitely use improvements. I may just create a gist or something if
>>> people want to contribute.
>>>
>>> http://pastebin.com/hBp7yxGJ
>>>
>>> It solves your issues regarding using the proper name attributes, etc.
>>>
>>> - Chris
>>>
>>> On Friday, October 3, 2014 2:01:59 PM UTC-4, Joberto Diniz wrote:
>>>>
>>>> Instead of evaluate the directive in the HEAD, angular is evaluating in
>>>> the BODY, but the *<meta name="{{meta.name <http://meta.name/>}}"
>>>> property="{{meta.property}}" content="{{meta.content}}" ng-repeat="meta in
>>>> metas" />* is being evaluating in the HEAD. Weird.
>>>>
>>>> I bootstrap angular manually, as I need to get some config values from
>>>> server before angular kicks in.
>>>>
>>>> On Friday, October 3, 2014 2:51:57 PM UTC-3, Majid Burney wrote:
>>>>>
>>>>> Angular will definitely apply directives in <head>, unless you’re
>>>>> bootstrapping the application (with ng-app) somewhere other than <html>,
>>>>> such as <body>.
>>>>>
>>>>> But if Angular is able to interpolate expressions and ng-repeat, then
>>>>> it should be able to use your custom directive. Something is likely off
>>>>> in
>>>>> the directive definition.
>>>>>
>>>>> On Friday, October 3, 2014 8:12:52 AM UTC-7, Joberto Diniz wrote:
>>>>>>
>>>>>> I have the following in *<head>* of html:
>>>>>>
>>>>>> *<meta name="{{meta.name <http://meta.name>}}"
>>>>>> property="{{meta.property}}" content="{{meta.content}}" ng-repeat="meta
>>>>>> in
>>>>>> metas" />*
>>>>>>
>>>>>> *metas* is an array that is added to *$rootScope*. However, there
>>>>>> are meta tags which require *name* and other which require *property*,
>>>>>> but not both. So, the way it is implemented, some *name* ou
>>>>>> *property* will be empty, and that is a problem.
>>>>>>
>>>>>> I thought of creating a directive *<meta-tags>* but it seems angular
>>>>>> doesn't parse it in *<head>* section. Any ideas?
>>>>>>
>>>>>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.