Angular is not defined error after creating SFX Bundle

81 views
Skip to first unread message

bste...@gmail.com

unread,
Dec 28, 2015, 5:00:13 PM12/28/15
to SystemJS
Every time I try to add in "Angular Loading Bar" and/or "Angular Material Icons" to my static SFX bundle I get the error that "Angular is not defined".

When I look at the static bundle results sure enough Angular is not listed as a dependency in the $__System.registerDynamic declaration for either libraries.

I decided to add angular as a dependency in the meta section of the config file I am using. Even though manually defining angular as a dependency it still doesn't seem to be added, unless I am implementing it wrong.

Below is how I am manually defining the dependency of angular for those libraries:

"meta":{
"github:angular/bower-...@1.4.8/angular": {
"exports": "angular"
},
"npm:angular-mat...@0.6.0": {
"deps": [
"angular"
]
},
"npm:angular-l...@0.8.0":{
"deps":[
"angular"
]
}
}

Guy Bedford

unread,
Jan 2, 2016, 4:03:08 PM1/2/16
to bste...@gmail.com, SystemJS
This is exactly the right approach, but the issue is that you need to reference the exact main file of each project, and not the project directly:

That is something like -

 "meta":{
    "github:angular/bower-...@1.4.8/angular": {
      "exports": "angular"
    },
    "npm:angular-mat...@0.6.0/index.js": {
      "deps": [
        "angular"
      ]
    },
    "npm:angular-l...@0.8.0/path/to/main.js":{
      "deps":[
          "angular"
      ]
    }
  }

I know this is a bit of a catch, but the issue is that we can't expect to know the main automatically at the time the configuration is created, to know exactly which module the metadata should be associated with.


--
You received this message because you are subscribed to the Google Groups "SystemJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to systemjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

bste...@gmail.com

unread,
Jan 5, 2016, 11:52:23 AM1/5/16
to SystemJS, bste...@gmail.com
Guy,

Thanks a ton! That did the trick.

Now it works just like it was intended.

Bryan

Reply all
Reply to author
Forward
0 new messages