frabbit / angular.haxe Goto Github PK
View Code? Open in Web Editor NEWToolset for integration of angular.js (https://angularjs.org) in haxe applications
License: MIT License
Toolset for integration of angular.js (https://angularjs.org) in haxe applications
License: MIT License
the signature for Q create is wrong.
the signuature
public function create<T, U>(resolve : T -> Void, reject : U -> Void) : Promise<T>;
should be
public function create<T, U>(fn:(T -> Void)->(U -> Void)->Void): Promise<T>;
Hey @frabbit!
I'm wondering how you're organizing your Angular 1.x controllers when using angular.haxe
? When using Angular with raw js or coffee, I just create separate files for each controller (in a app/controllers/
folder, later to be processed by an assets pipeline - webpack or maybe rails).
With angular.haxe
, in the example shown in the README
, you define the controller function in the main class' main
function, which works but can turn into a huge mess for bigger apps.
Do you wrap those as static functions in Haxe classes?
Any hints appreciated!
I'm testing this library today, and I'm using a nightly build of haxe, like is stated in the other issue.
I noticed that simple variables in ng-model isn't working, they appear empty in the controllers. They need to be something like this to work:
<input type="text" ng-model="data.entry" />
var data = {
entry: ""
};
scope.set("data", data);
app.directive('postRender', [ '$timeout', function($timeout) {
var def = {
restrict : 'A',
terminal : true,
transclude : true,
link : function(scope, element, attrs) {
$timeout(scope.resize, 0); //Calling a scoped method
}
};
return def;
}])
How to inject the $timeout
like in the code above?
Creating a small module using this code:
var myApp = Angular.module('myApp', []);
myApp.run(function(s:TemplateCache) {
s.put('test', 'hahahhhhahahaha');
});
produces the following js:
myApp.runDynamic(["$templateCache",function(s) {
s.put("test","hahahhhhahahaha");
}]);
which produces the error:
Uncaught TypeError: Object #<Object> has no method 'runDynamic'
Any clue why this is happening? Using git version of angular.haxe and angular 1.3.12.
Using TypedScope I'm loosing all the scope class functionalities.
How can refresh angular after any external event if I can't access to "apply()" ?
is this still maintained? I want to add it to awesome-angular2
https://github.com/angular-class/awesome-angular2
update: nvm I found the wrong repo (looking for Angular 2
I am really looking forward to working with Haxe and Angular, but I currently have the problem that the following code:
var module = Angular.module("myModule", [])
.factory(Config.new)
.controller("AppController", appController);
Is compiled into:
var module = window.angular.module("myModule",[]).factoryDynamic("Config",[function() {
return new Config();
}]).controllerDynamic("AppController",["$scope","Config",appController]);
Even though the methods are marked with for example:
@:noCompletion @:native("controller") public function controllerDynamic (name:String, value:Dynamic):Module;
It seems the @:native is not used.
Did anyone else run into this problem?
I am using Haxe 3.1.3
I was trying to get started, when all the code I had been writing came up with runtime errors. I thought I might have been doing something wrong, so I tried compiling the sample projects. I ran into a similar problem. Sample 1 came up with a bunch of compile-time errors. Sample two compiled, and I was greeted with similar runtime errors I was getting in my own code:
TypeError: undefined is not a function (evaluating 'window.angular.module("myModule",[]).factoryDynamic("News",["Config",function(c) {
return new News(c);
}])')
Any ideas what's going on? I'm running Haxe 3.1.3 and running the version of Angular being loaded in the example file.
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.