PatrickJS on master
Update README.md (compare)
Hello Friends!
I am looking for some help. I am trying to import rx-angular
into my application by add the following in home.js:
import angular from 'angular';
import homeComponent from './home.component';
import rx from 'rx-angular';
let homeModule = angular.module('home', [
'firebase',
rx
])
.component('home', homeComponent)
.name;
export default homeModule;
I am however getting this error from webpack, do ya'll any idea of what I am doing worng. Thanks for the help.
Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:modulerr] Failed to instantiate module app.components due to:
Error: [$injector:modulerr] Failed to instantiate module home due to:
Error: [$injector:modulerr] Failed to instantiate module {"internals":{},"config":{"longStackSupport":false,"useNativeEvents":false},"helpers":{},"doneEnumerator":{"done":true},"ReactiveTest":{"created":100,"subscribed":200,"disposed":1000}} due to:
Error: [ng:areq] Argument 'module' is not a function, got Object
Hi guys. My problem is that ui-router events $stateChangeStart and $stateChangeSuccess doesn't work in this template. I put this code
$rootScope.$on('$stateChangeStart', function(){
console.log('start');
})
$rootScope.$on('$stateChangeSuccess', function(){
console.log('success');
})
at run function in app.js file. When i change the state nothing happend.
Hi @arturoromeroslc
Hello Friends!
I am looking for some help. I am trying to import rx-angular
into my application by add the following in home.js:
import angular from 'angular';
import homeComponent from './home.component';
import rx from 'rx-angular';
let homeModule = angular.module('home', [
'firebase',
rx
])
.component('home', homeComponent)
.name;
export default homeModule;
I am however getting this error from webpack, do ya'll any idea of what I am doing worng. Thanks for the help.
Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:modulerr] Failed to instantiate module app.components due to:
Error: [$injector:modulerr] Failed to instantiate module home due to:
Error: [$injector:modulerr] Failed to instantiate module {"internals":{},"config":{"longStackSupport":false,"useNativeEvents":false},"helpers":{},"doneEnumerator":{"done":true},"ReactiveTest":{"created":100,"subscribed":200,"disposed":1000}} due to:
Error: [ng:areq] Argument 'module' is not a function, got Object
Did you find the solution ? i get exactly the same problem :/ . Thank you
let homeModule = angular.module('home', [
'firebase',
'rx'
])
angular.module('assessments', [
uiRouter,
Common,
Components
])
.config(($locationProvider) => {
"ngInject";
// @see: https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions
// #how-to-configure-your-server-to-work-with-html5mode
$locationProvider.html5Mode(true).hashPrefix('!');
})
import angular from 'angular';
import uiRouter from 'angular-ui-router';
import HomeComponent from './home.component';
import HomeConfig from './home.config';
let homeModule = angular.module('home', [
uiRouter
])
.config(HomeConfig)
.component('home', HomeComponent)
.name;
export default homeModule;
let homeConfig = function($urlRouterProvider, $stateProvider) {
"ngInject";
$urlRouterProvider.otherwise('/');
$stateProvider
.state('home', {
url: '/',
component: 'home'
});
};
export default homeConfig;
.config(($stateProvider) => {
"ngInject";
$stateProvider
.state('welcome', {
url: '/',
component: 'welcome',
resolve: {
'currentAuth': function (Auth) {
"ngInject";
return Auth.$waitForSignIn();
}
}
});
})
class WelcomeController {
constructor(currentAuth) {
"ngInject";
console.log(currentAuth);
this.name = 'welcome';
}
}
src/app
and my test files in test/unit
.
spec.bundle.js
file or the karma config so that it loads the correct source and test files
forEach@webpack:///~/angular/angular.js:321:0 <- spec.bundle.js:390:25
loadModules@webpack:///~/angular/angular.js:4601:0 <- spec.bundle.js:4670:13
createInjector@webpack:///~/angular/angular.js:4523:0 <- spec.bundle.js:4592:31
workFn@webpack:///~/angular-mocks/angular-mocks.js:3074:0 <- spec.bundle.js:34916:61
inject@webpack:///~/angular-mocks/angular-mocks.js:3054:0 <- spec.bundle.js:34896:47
webpack:///src/app/app.config.spec.js:9:0 <- spec.bundle.js:35004:12
loaded@http://localhost:9876/context.js:151:17
webpack:///~/angular/angular.js:4641:0 <- spec.bundle.js:4710:54
src/app
just to see if it would work
gulp webpack
and then simply serve the dist
directory. Can i have this in dev
mode also? Basically I am trying to render the initial state on the server (using ejs/jade) and set it as a global variable in a script tag. The angular app will then load this initial state.
15 12 2016 10:25:29.091:INFO [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Connected on socket 491w3G-X2bh-KHZgAAAA with i
d 92737466
PhantomJS 2.1.1 (Mac OS X 0.0.0) LOG: 'WARNING: Tried to load angular more than once.'
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
TypeError: undefined is not a constructor (evaluating 'window.angular.$$csp()')
at <myfolder>/spec.bundle.js:33019