Discussion:
Firefox extensions in AngularJS
Shaun Donnelly
2014-02-28 16:27:40 UTC
Permalink
I'm wondering if anybody's developed a Firefox extension using AngularJS.

Currently, I'm porting a Chrome extension to Firefox. For some reason, in
Firefox, loading external templates doesn't work. Here's an example of a
directive that works fine inside a Chrome extension:

// Rest of code omitted.
.directive('myDirective', function () {
return {
restrict : 'E',
templateUrl : '/templates/directives/mydirective.html',
replace : true
}
})
// Rest of code omitted.


To make this work in Firefox, the template has to be declared inline:

// Rest of code omitted.
.directive('myDirective', function () {
return {
restrict : 'E',
template : '<div>my directive goes here</div>',
replace : true
}
})
// Rest of code omitted.

The venn diagram of AngularJS developers and Firefox extension developers doesn't seem to have much of an intersection, so I'm hoping somebody here can help out a little!

Shaun
--
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 angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
Евгений Хлобыстин
2014-02-28 17:46:35 UTC
Permalink
Look at this http://docs.angularjs.org/api/ng/directive/script
Post by Shaun Donnelly
I'm wondering if anybody's developed a Firefox extension using AngularJS.
Currently, I'm porting a Chrome extension to Firefox. For some reason, in
Firefox, loading external templates doesn't work. Here's an example of a
// Rest of code omitted.
.directive('myDirective', function () {
return {
restrict : 'E',
templateUrl : '/templates/directives/mydirective.html',
replace : true
}
})
// Rest of code omitted.
// Rest of code omitted.
.directive('myDirective', function () {
return {
restrict : 'E',
template : '<div>my directive goes here</div>',
replace : true
}
})
// Rest of code omitted.
The venn diagram of AngularJS developers and Firefox extension developers doesn't seem to have much of an intersection, so I'm hoping somebody here can help out a little!
Shaun
--
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
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
--
ó õ×ÁÖÅÎÉÅÍ,
èÌÏÂÙÓÔÉÎ å×ÇÅÎÉÊ
--
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 angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
Sander Elias
2014-03-01 05:27:09 UTC
Permalink
Hi Shaun,

There is more than 1 way to get a template into memory.
For most of my projects is use html2js<https://github.com/karlgoldstein/grunt-html2js>.
this turns my template's into a module that fills the $templatecache<http://docs.angularjs.org/api/ng/service/$templateCache>
.
For small things you can manage the $templateCache by hand.

Regards
Sander
--
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 angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
Shaun Donnelly
2014-03-04 10:13:22 UTC
Permalink
This looks like a great solution. Thanks!
Post by Sander Elias
Hi Shaun,
There is more than 1 way to get a template into memory.
For most of my projects is use html2js<https://github.com/karlgoldstein/grunt-html2js>.
this turns my template's into a module that fills the $templatecache<http://docs.angularjs.org/api/ng/service/$templateCache>
.
For small things you can manage the $templateCache by hand.
Regards
Sander
--
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 angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
Loading...