laurelnaiad / angular-couch-potato Goto Github PK
View Code? Open in Web Editor NEWLazy-Load and Register Components in AngularJS Applications
License: Other
Lazy-Load and Register Components in AngularJS Applications
License: Other
What will appear here?
I have a situation where my app needs to enter a certain state only after a vendor library has run it's own proprietary script loading mechanism. Basically, I need to listen for the following:
document.on('mp_ready', function() {
//resolve
});
What is the proper way to accomplish this?
Thanks!
I think it need to add the minify file angular-couch-potato.min.js
in the dist folder.
Thanks!
I am trying the sample codes, it's really nice to lazy load controllers in the routes, but failed to load the Main controller and causing error with the "ng-controller='MainCtrl'" in index.html. Is there a best practice for loading main controller for ng apps?
error.
I think that the dependencies is too new.But the relevant code is not matching.
May be I need add angular-router into html.
Whatever, I hope you can fix it.
Currently we cannot register constants via CouchPotato.
ui-router-sample:
I make some changes in files to make it work in apache.
It really works.
But there is a problem when refresh page, it occurs a problem:
(except home).
I also try some changes to fix it.
But may be you can give me a help quickly,If I post it here.
https://github.com/kuma0605/angularjs-ui-router-couch-potato
you can clone it, put it in apache. Have a try.
Hi, how would one add http interceptor factory to a project that uses couch potato? I have tried but cannot get it to work.
This is all based upon your ui-router sample where I got your stuff as written to work. Now unto my stuff :0
I tried adding paths to my directives as follows in routeDefs.js and they were not picked up by the view.
resolve: {
dummy: $couchPotatoProvider.resolveDependencies([
'controllers/ContactViewController',
'directives/app-color',
]),
I then put them in the require define in the routeDefs.js and then they worked in my view.
define([
'app',
'directives/app-color'
], function(app) {...}
any clue as to why the require in your $couchPotatoProvider.resolveDependencies gets the controller to work but the directives aren't coming in?
This is really a broader question where I would like to bring in a bunch of stuff for the route, like services, factories, directives, etc.
Thanks
H
Hi @laurelnaiad,
Great initiative here! In the docs it says you intend to allow ad-hoc loading of modules. My question is: do you have an example of how to do this? Also, will doing this require (ehem) require.js?
Thanks!
Andy
Many people in China use seajs [http://seajs.org/docs/]
My code is like this:
.state('partials.main', {
// parent: 'partials',
url: '/{func}/main',
resolve: {
dummy: function ($stateParams){
var s = $couchPotatoProvider.resolveDependencies(['controllers/'+$stateParams.func+'Controller']);
return s;
}
},
templateUrl:
function ($stateParams){
return '/partials/'+$stateParams.func + '/main.html';
},
controllerProvider:
function ($stateParams){
return $stateParams.func + 'Controller';
}
})
but the code:
resolve: {
dummy: function ($stateParams){
var s = $couchPotatoProvider.resolveDependencies(['controllers/'+$stateParams.func+'Controller']);
return s;
}
does not work!
can I get any help ?
thanks a lot!
Angular released the angular.component in angular 1.5. This issue is a new feature request to support:
angular.module(<moduleName>).registerComponent(<componentName>, <componentConfig>);
The documentation is missing the sref in the internal links of each section of the guide, so is a potato couch's problem or just is because de documentation is in progress yet?. However cheroois by u project is AMAZING!, how can i involve in with him more ?. My target is make a huuuuugeeeee app, but i really not understand at all, how can i write it in a collaborative way?. I'm tried say: With a team in a huge app within a ui-router how this would configure dinamically the stateProvider when others developers comes to contribute with something new and then will write in a stateprovider path of router, manually?.
see afterglowtech/angular-couchPotato#2 ... need to establish tests for couch-potato as well as guide for testing apps that use couch-potoato.
I was reading your comments on angular google group.
Is there any progress on making angular-couch-potato work with AngularUI Router?
hot do lazy load the js routes and its template html lazily and dynamically from server side.
this means that if the url[state] is not found locally. It will query the server lets say findRoute(name:'abc') which returns json, js of state, template html; which will be injected into crouch-potato and served to the client.
I've done the same installation as the sample one (ui-router). Everything seems good and works well except the my directives (which was good before I applied the lazy load). I don't understand why, but the controllers which has directives doesn't apply the modification/transformation in the view.
When I add the controller's directives into it's define() the network panel loads it properly but it does nothing and I don't receive error message :(
Could someone help me?
update: The invokeQueue also doesn't contain the mentioned directives :(
Thanks for the great lib. If I follow the sample README.md i cant find the server.js?
cd into components-demo or ui-router-sample
node server.js
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.