RequireJS takes charge of loading js files into browser, while Angular
injects correct
correct object when creating modules.
That is to say, your js files should at first be in the browser before
Angular injection.
so you need to
require([
'angular',
'app',
'angularSanitize'
......
BTW, your requireJS main module seems a little strange, I just used the
following logic,
angular.bootstrap(document, [ "mail" ]);
Hope this helps.
On Wednesday, December 25, 2013 9:26:53 PM UTC+8, [email protected] wrote:
>
> Hi there,
>
> I'm currently in need of ngSanitize for an Angular project. But I dont get
> it to work.
> I'm using the requirejs-angular-seed from
> https://github.com/angular/angular-seed
>
> The thing is, I have to use 'ng-bind-html' and therefore I need to import
> the angular-sanitize module.
> But with requireJS it never seems to get loaded.... this is my
> require-configuration-file:
>
> require.config({
> paths: {
> angular: '../bower_components/angular/angular',
> angularSanitize:
> '../bower_components/angular-sanitize/angular-sanitize'
> },
> shim: {
> 'angular' : {'exports' : 'angular'},
> 'angularSanitize' : {'deps' : 'angular'}
> },
> priority: [
> "angular"
> ]
> });
>
> //
> http://code.angularjs.org/1.2.1/docs/guide/bootstrap#overview_deferred-bootstrap
> window.name = "NG_DEFER_BOOTSTRAP!";
>
> require( [
> 'angular',
> 'app'
> ], function(angular, app) {
> 'use strict';
>
> var $html = angular.element(document.getElementsByTagName('html')[0]);
>
> angular.element().ready(function() {
> angular.resumeBootstrap([app['name']]);
> });
> });
>
>
>
> I dont know how to make angular-sanitize work with requireJS? Any
> recommendations or best practices?
>
>
> Thanks in advance and cheers,
> Martin
>
--
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/groups/opt_out.