cannot get the comments to show in actionscript file when running asdoc.. is this a known bug?
[Bindable]
/** test comment */
public var currentSearchTextValue:String;
does not show anything in the generated documentation... am I doing something wrong?
[Bindable] actually generates code that wraps the property, so it might not be possible. Try moving [Bindable] to after your comments, but failing that you might be out of luck I'm afraid.
Although I don't see anything wrong here, I would follow the ASDOC best practices - putting the comments in separate line with a preceding asterisk as suggested here and see if that works.
[Bindable]
/**
* Test comment
*/
public var currentSearchTextValue:String;
I am having the same issue and have posted a detailed question here. no answers yet.
One workaround is to use an event name along with the Bindable tag
[Bindable("someEvent")]
/*
* asdoc comment
* */
public var currentSearchTextValue:String;
but this wud require u to dispatch "someEvent" manually to get binding work. So u might wanna use this for generating asdoc alone and change it back to the older version afterwards.
Related
I have an ng-class attribute (that I didn't write on my own). It is bound to a string variable in the controller . It looks like: <some-tag ng-class="'indicator_' + $ctrl.stringValue"></some-tag>.
When the window first load - it contain the correct data, but after the string is updated in the controller - the value in the class attribute only updates after I'm clicking the element (the click will open a list, but I don't think it's relevant).
I've read that the first thing to check in these cases, is that the code is surrounded by a $scope.$apply. It is, cause when I try to add it - I get an error saying "$digest already in progress".
Looking for $ctrl and ng-class info, I read the AngularJS component doc and this site, that gave me some basic background about these subjects.
The thing is, I couldn't find any examples of ng-class with $ctrl. Maybe it's irrelevant, but maybe not :)
Example for an irrelevant question I found in the subject is: Angular ngClass is not updating my classes even though my condition change as expected.
In general, most of the examples I found include curly brackets, which I don't think are relevant in this case, since I'm binding a string (maybe I'm mistaking about it :) ).
I suspect it probably didn't bind it correctly, I just don't know why.
Edit:
After continuing to search the subject, I'm no longer sure it's related to the ng-class (so I edited the title as well). It looks more like a refresh problem.
I'm puzzled as to why the page doesn't refresh, since everywhere I read - they say that the Angular should call the digest function on its own, and I should not interfere.
Edit2:
I'm working with typeScript, and the stringValue is updated via an event from a service. But the string does update - so I'm not sure it is a relevant information to understand the problem, but worth mentioning :)
Problem solved!! :D
All I had to do, is to add $timeout(0) after updating the string in the controller!
The explanation: it was a digest problem, and the reason I couldn't use $scope.$apply(), is because I was trying to do it directly. I needed to do a safe apply, which means - first make sure there's no digest on that scope, and then run apply.
Turns out that an easy way to do it, is to use $timeout(0).
I prepared a plunker with Angular 1.5.7 with a demo of what you described. There doesn't seem to be any problem, or anything special you should do. (I used a different alias for the controller, which is the best practice, but $ctrl works fine as well.)
https://plnkr.co/edit/wCpBQ5?p=preview
const DemoComponent = {
controller: DemoController,
controllerAs: 'demoCtrl',
template: `
<h2 ng-class="'demo_' + demoCtrl.classSuffix">{{ demoCtrl.classSuffix }}</h2>
<button ng-click="demoCtrl.changeClass()">Change Class</button>
`
}
angular.module('myapp', [])
.component('demo', DemoComponent);
It will be very helpful if you can reproduce the issue in plunker and post the link.
Otherwise, I hope you find the answer in this plunker.
I just discovered the "CustomScrollPanel" and it seems to be a great piece of GWT. I also noticed that is is also possible to add a custom "NativeVerticalScrollbar".
However, I could not find out so far how to apply CSS to this object. I searched the web but did not find anything. In the source repository on github I discovered the file https://github.com/gwtproject/gwt/blob/master/user/src/com/google/gwt/user/client/ui/NativeVerticalScrollbar.css however, it is empty.
So, can anybody please give an example what kind of css can be applied in order to style the scrollbar?
You you familiar with ClientBundle? Take a look at the source code of the CustomScrollPanel or the NativeVerticalScrollbar
They both have a declarion of a Resources interface, all you need to do is to extend this interface and bundle a new CSS (or GSS) with your style.
This is the current Resources interface for the NativeVerticalScrollbar
/**
* A ClientBundle of resources used by this widget.
*/
public interface Resources extends ClientBundle {
/**
* The styles used in this widget.
*/
#Source(Style.DEFAULT_CSS)
Style nativeVerticalScrollbarStyle();
}
Create the CSS (or GSS) that you want, customize it away. It has to respect the Style Interface declaration (and the compiler fails if you don't)
public interface MyNewResource extends com.google.gwt.user.client.ui.NativeVerticalScrollbar.Resource {
/**
* The styles used in this widget.
*/
#Source("/PATH_TO_YOUR_CSS/newCss.css")
com.google.gwt.user.client.ui.NativeVerticalScrollbar.Style nativeVerticalScrollbarStyle();
}
Then when you create a new widget, just pass MyNewResource instance to the widget
MyNewResource resources = GWT.create(MyNewResource.class)
NativeVerticalScrollbar myScrollBar = new NativeVerticalScrollbar(resources);
Consider the following scenario:
Test class:
class Test{
protected $title;
protected $description;
}
Base Question class:
class BaseQuestion{
protected $Test
protected $question;
}
Text Question class:
class TextQuestion extends BaseQuestion{
}
Checkbox Question class:
class CheckboxQuestion extends BaseQuestion{
protected $options;
}
So I have all this setup, now I need an easy way for people to create new tests with questions.
I first started by using Sonata Admin as a CMS, which was working fine as long as I didn't use polymorphism and just used 1 type of question. Using the inline option you could create questions when you were creating test. However including the inheritance to Sonata Admin with their inline option proved to be unsuccessful.
I then tried to remove all the Sonata Admin stuff and just build a plain form to do this but again, with only 1 type of question this works very well with embedded forms. But as soon as I tried implementing it with the inheritance classes, things proved more difficult.
I tried using the Infinite PolyCollection Bundle but couldn't find anything on how to display the form. I then found the Arse Polycollection bundle (which uses the Infinite bundle) but can't get it to work even though I was following the tutorial step by step.
Currently it's giving me the following error:
FatalErrorException: Error: Call to undefined method Symfony\Component\Form\FormBuilder::getTypes()
I am getting clueless on how to proceed with this, has anyone got the above bundles working before?
Or do you have other suggestions on how to set up a (small) CMS system for this?
Update:
I basically did everything manual now and it's working but I do hope they include a way of doing this with the framework in the future.
I'd like to overwrite the buildSkeleton method used in the fullCalendar plugin.
I'm trying to remove the table,tr,td and replace them with regular divs.
Thanks
If we take a look at https://github.com/arshaw/fullcalendar/blob/master/src/basic/BasicView.js you'll see the buildSkeleton is a private function. However, renderBasic is public and makes use of buildSkeleton.
If you can successfully override the renderBasic you should be all good to go. However, your optimal path might be to actually fork the project (it obviously is open source) and add in the option of using a div skeleton over a table skeleton.
I know that you can apply CSS in order to style objects in Flex using the StyleManager:
http://livedocs.adobe.com/flex/3/html/help.html?content=styles_07.html
You can also load compiled CSS files (SWFs) dynamically:
http://livedocs.adobe.com/flex/3/html/help.html?content=styles_10.html
However, I'm dynamically creating my CSS files using a web GUI and a server-side script.
If the CSS is changed, then the script would also need to compile the CSS into an SWF (which is not a viable option). Is there any way around this?
In this comment to an issue related to this in the Adobe bug tracker T. Busser is describing what might be a viable solution for you:
"I've created a small class that will 'parse' a CSS file read with an
HTTPService object. It takes apart the
string that is returned by the
HTTPService object, break it down into
selectors, and create a new
CSSStyleDeclaration object for each
selector that is found. Once all the
properties are assigned to the
CSSStyleDeclaration object it's added
to the StyleManager. It doesn't
perform any checks, you should make
sure the CSS file is well formed, but
it will be sufficient 99% of the time.
Stuff like #font, Embed() and
ClassReference() will hardly be used
by my customers. They do need the
ability to change colors and stuff
like that so they can easily theme the
Flex application to their house
style."
You could either try to contact this person for their solution or alternatively maybe use the code from this as3csslib project as a basis for writing something like what they're describing.
You can also implement dynamic stylesheet in flex like this . Here i found this article :
http://askmeflash.com/article_m.php?p=article&id=6
Edit: This solution does not work. All selectors that are taken out of the parser are converted to lowercase. This may work for your application but it will probably not...
I am leaving this answer here because it may help some people looking for a solution and warn others of the limitations of this method.
See my question: "Looking for CSS parser written in AS3" for a complete discussion but I found a CSS parser hidden inside the standard libraries. Here is how you can use it:
public function extractFromStyleSheet(css:String):void {
// Create a StyleSheet Object
var styleSheet:StyleSheet = new StyleSheet();
styleSheet.parseCSS(css);
// Iterate through the selector objects
var selectorNames:Array = styleSheet.styleNames;
for(var i:int=0; i<selectorNames.length; i++){
// Do something with each selector
trace("Selector: "+selelectorNames[i];
var properties:Object = styleSheet.getStyle(selectorNames[i]);
for (var property:String in properties){
// Do something with each property in the selector
trace("\t"+property+" -> "+properties[property]+"\n");
}
}
}
You can then apply the styles using:
cssStyle = new CSSStyleDeclaration();
cssStyle.setStyle("color", "<valid color>);
FlexGlobals.topLevelApplication.styleManager.setStyleDeclaration("Button", cssStyle, true);
The application of CSS in Flex is handled on the server side at compilation and not on the client side at run time.
I would see two options then for you (I'm not sure how practical either are):
Use a server side script to compile your CSS as a SWF then load them dynamically.
Parse a CSS Style sheet and use the setStyle functions in flex to apply the styles. An similar example to this approach is the Flex Style Explorer where you can check out the source.
Good luck.