Questions tagged [angular-amd]

angularAMD is an utility that facilitate the use of RequireJS in AngularJS applications supporting on-demand loading of 3rd party modules such as angular-ui.

59 questions
2
votes
1 answer

Using AngularJS with RequireJS via AngularAMD: Cannot read property 'directive' of undefined

Having created a very basic prototype AngularJS project, I wanted to migrate it to use RequireJS to load the modules. I modified my app based on the AngularAMD and AngularAMD-sample projects. Now, when I access my default route I get: Uncaught…
DaveAlden
  • 30,083
  • 11
  • 93
  • 155
2
votes
1 answer

AngularAMD, Dynamic UI-Router, RequireJS - "Error: 'MyDashboardCtrl' is not a function, got undefined"

Intro: I recognize that this is really deep and I won't probably get any help here but I have exhausted what seems like the entire Internet for a solution. The short of it is I want to make my ui-router dynamic, and with that the controllers, WHILE…
user1177440
1
vote
0 answers

AngularAMD fails when trying to inject a service

I am trying to create an authentication module and when I try to inject my Authentication service, it fails to load that module. Here's my code - AuthenticationController.js define(['app',"../services/AuthenticationService"], function (app)…
Pratik
  • 695
  • 2
  • 11
  • 29
1
vote
1 answer

How do I inject ngCookies into a controller within an angularAMD define()?

I am new to AMD. This worked before AMD like this: angular.module('app') .controller('RegisterCtrl', ['$scope', '$location', '$http', '$cookies', '$timeout', 'myConfig', function($scope, $location, $http, $cookies, $timeout, myConfig) { …
1
vote
1 answer

AngularAMD fails to load controller after r.js

It seems like I miss running r.js over code with AngularAMD. .when('/', angularAMD.route({ templateUrl: 'views/home.html', controller: 'HomeCtrl', controllerUrl: 'controllers/home', data: { name: 'home' } })) I have…
Guy Korland
  • 9,139
  • 14
  • 59
  • 106
1
vote
1 answer

How to create and use separate file for each language in angular-translate with requirejs-angularAMD?

Using angualr-translate with requirejs. Want to create separate files for each language (contains translate keys), for the time it is all in app.js. Example- app.js define(['angularAMD', 'ngRoute','pascalprecht.translate'], function (angularAMD)…
VBMali
  • 1,360
  • 3
  • 19
  • 46
1
vote
1 answer

Requirejs: Load Dependancies only when needed

The dependancies defined in define block of app.js get loaded. What I want to do is: If I am going to load Dashboard controller it requires charts related dependancy,and any other controller never needs this dependancy. Problem: When App loads, all…
VBMali
  • 1,360
  • 3
  • 19
  • 46
1
vote
1 answer

how to use chart.js with angular-chart using requirejs

Trying to implement lazy load using requirejs. Everything is fine when I am not using charts. But when I want to use charts(angular charts), not going to sucseed! Using chart.js with angular-chart. Here is main.js: require.config({ baseUrl:…
VBMali
  • 1,360
  • 3
  • 19
  • 46
1
vote
1 answer

is there away to set page's title in angularAMD like it is in $routeProvider?

I am trying to achive something like this: $routeProvider.when("/home", angularAMD.route({ title: 'Home', templateUrl: 'views/home.html', controller: 'testCtrl' })) Like in this post about $routeProvider How to dynamically change…
Linh Pham
  • 3,005
  • 23
  • 34
1
vote
1 answer

ngMock is throwing template load error because of ngRoute's $routeProvider...?

I just included ngMock into my project because I need it for $httpBackend. I have a bunch of karma/jasmine tests setup, and after including ngMock, everything is breaking because of an error it causes: PhantomJS 1.9.7 (Windows 7): Executed 0 of 41…
BuildTester1
  • 625
  • 1
  • 7
  • 22
1
vote
0 answers

angularAMD: view does not wait for loading js

I have problem with angularAMD. Main.js: require.config({ baseUrl: "/assets/static/app", paths: { app: 'app', angular: '../angular/angular', angularAMD: '../require/angularAMD', …
marvelsrp
  • 11
  • 1
1
vote
2 answers

Error In Getting AngulaJS + Angular AMD + RequireJS to Work with Karma and Jasmine

I ma trying to add Karma & Jasmine+Require Js based Unit testing support for an AngularJS +Angular AMD & RequireJS Application that I have created. I have been wrecking my brain around this for two days now but I am still nowhere close to sealing…
msrameshp
  • 626
  • 2
  • 12
  • 33
1
vote
1 answer

Is it possible to lazy-load and inject angular modules into the app in runtime using angularAMD?

I have ng-grid as a dependency when defining the app: var app = angular.module('myApp', ['ngGrid']); But not all my views and controllers need ngGrid, so I was thinking if it could be possible to load and inject ngGrid into the app while defining…
NicolasZ
  • 119
  • 1
  • 9
1
vote
1 answer

define in require function (requireJS)

(Using requireJS, angularJS, angularAMD) When in my main.js file I have: require.config({ baseUrl: "js", paths: { 'angular': 'libs/angularjs/angular.min', 'angularAMD': 'libs/angularjs/angularAMD.min' }, shim: { …
piernik
  • 3,507
  • 3
  • 42
  • 84
1
vote
2 answers

'undefined' is not an object (evaluating 'app.register.service') when using requirejs, angularamd and karma

In our angularjs project, we are using requirejs + angularAMD to manage dependencies. The application works fine, but we're having problems when running the jasmine tests using karma. This is the error: TypeError: 'undefined' is not an object…
redwulf
  • 1,317
  • 3
  • 13
  • 35