diff --git a/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/html/angular/messages.properties b/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/html/angular/messages.properties index 725354c23..850010ac8 100644 --- a/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/html/angular/messages.properties +++ b/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/html/angular/messages.properties @@ -1,36 +1,37 @@ -AngularAttributeProvider_NgChange= -AngularAttributeProvider_NgMaxlength= -AngularAttributeProvider_NgMinlength= -AngularAttributeProvider_NgModel= -AngularAttributeProvider_NgPattern= -AngularAttributeProvider_NgRequired= -NameAttributeProvider_Name= -NgAnyClassAttribute_NgBind= -NgAnyClassAttribute_NgClass= -NgAnyClassAttribute_NgClassEven= -NgAnyClassAttribute_NgClassOdd= -NgAnyClassAttribute_NgCloak= -NgAnyClassAttribute_NgForm= -NgAnyClassAttribute_NgInclude= -NgAnyClassAttribute_NgInit= -NgAnyClassAttribute_NgStyle= -NgAnyClassAttribute_NgTransclude= -NgAnyInputAttributeProvider_NgChecked= -NgAnyInputAttributeProvider_NgList= -NgAppAttributeProvider_NgApp= -NgBlurAttributeProvider_NgBlur= -NgBlurAttributeProvider_NgFocus= -NgDisabledAttributeProvider_NgDisabled= -NgImageAttributeProvider_NgSrc= -NgImageAttributeProvider_NgSrcset= -NgInputCheckboxAttributeProvider_NgFalseValue= -NgInputCheckboxAttributeProvider_NgTrueValue= -NgInputTextAttributeProvider_NgTrim= -NgLinkAttributeProvider_NgHref= -NgModelAttributeProvider_NgReadOnly= -NgPluralizeAttributeProvider_Count= -NgPluralizeAttributeProvider_NgPluralize= -NgPluralizeAttributeProvider_Offset= -NgPluralizeAttributeProvider_When= -NgSubmitAttributeProvider_NgSubmit= -NgSwitchAttributeProvider_NgSwitch= +# Attribute descriptions from AngularJS API docs - http://docs.angularjs.org/api/ +AngularAttributeProvider_NgChange=Angular expression to be executed when input changes due to user interaction with the input element. +AngularAttributeProvider_NgMaxlength=Sets maxlength validation error key if the value is longer than maxlength. +AngularAttributeProvider_NgMinlength=Sets minlength validation error key if the value is shorter than minlength. +AngularAttributeProvider_NgModel=ngModel is a directive that tells Angular to do two-way data binding. It works together with input, select, textarea and even custom form controls that use NgModelController exposed by this directive. +AngularAttributeProvider_NgPattern=Sets pattern validation error key if the value does not match the RegExp pattern expression. Expected value is /regexp/ for inline patterns or regexp for patterns defined as scope expressions. +AngularAttributeProvider_NgRequired=Adds required attribute and required validation constraint to the element when the ngRequired expression evaluates to true. Use ngRequired instead of required when you want to data-bind to the required attribute. +NameAttributeProvider_Name=Name of the form. If specified, the form controller will be published into related scope, under this name. +NgAnyClassAttribute_NgBind=The ngBind directive tells Angular to replace the text content of the specified HTML element with the value of a given expression, and to update the text content when the value of that expression changes. +NgAnyClassAttribute_NgClass=The ngClass allows you to set CSS classes on HTML an element, dynamically, by databinding an expression that represents all classes to be added. +NgAnyClassAttribute_NgClassEven=The ngClassOdd and ngClassEven directives work exactly as ngClass, except it works in conjunction with ngRepeat and takes affect only on odd (even) rows. +NgAnyClassAttribute_NgClassOdd=The ngClassOdd and ngClassEven directives work exactly as ngClass, except it works in conjunction with ngRepeat and takes affect only on odd (even) rows. +NgAnyClassAttribute_NgCloak=The ngCloak directive is used to prevent the Angular html template from being briefly displayed by the browser in its raw (uncompiled) form while your application is loading. Use this directive to avoid the undesirable flicker effect caused by the html template display. +NgAnyClassAttribute_NgForm=Nestable alias of form directive. HTML does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a sub-group of controls needs to be determined. +NgAnyClassAttribute_NgInclude=Fetches, compiles and includes an external HTML fragment. +NgAnyClassAttribute_NgInit=The ngInit directive specifies initialization tasks to be executed before the template enters execution mode during bootstrap. +NgAnyClassAttribute_NgStyle=The ngStyle directive allows you to set CSS style on an HTML element conditionally. +NgAnyClassAttribute_NgTransclude=Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion. +NgAnyInputAttributeProvider_NgChecked=The HTML specs do not require browsers to preserve the special attributes such as checked. (The presence of them means true and absence means false) This prevents the angular compiler from correctly retrieving the binding expression. To solve this problem, use the ngChecked directive. +NgAnyInputAttributeProvider_NgList=Optional delimiter that should be used to split the value. If specified in form /something/ then the value will be converted into a regular expression. +NgAppAttributeProvider_NgApp=Use this directive to auto-bootstrap an application. Only one ngApp directive can be used per HTML document. The directive designates the root of the application and is typically placed at the root of the page. +NgBlurAttributeProvider_NgBlur=Specify custom behavior on blur event. +NgBlurAttributeProvider_NgFocus=Specify custom behavior on focus event. +NgDisabledAttributeProvider_NgDisabled=The HTML specs do not require browsers to preserve the special attributes such as disabled. (The presence of them means true and absence means false) This prevents the angular compiler from correctly retrieving the binding expression. To solve this problem, use the ngDisabled directive. +NgImageAttributeProvider_NgSrc=Using Angular markup like {{hash}} in a src attribute doesn't work right: The browser will fetch from the URL with the literal text {{hash}} until Angular replaces the expression inside {{hash}}. The ngSrc directive solves this problem. +NgImageAttributeProvider_NgSrcset=Using Angular markup like {{hash}} in a srcset attribute doesn't work right: The browser will fetch from the URL with the literal text {{hash}} until Angular replaces the expression inside {{hash}}. The ngSrcset directive solves this problem. +NgInputCheckboxAttributeProvider_NgFalseValue=The value to which the expression should be set when not selected. +NgInputCheckboxAttributeProvider_NgTrueValue=The value to which the expression should be set when selected. +NgInputTextAttributeProvider_NgTrim=If set to false Angular will not automatically trimming the input. +NgLinkAttributeProvider_NgHref=Using Angular markup like {{hash}} in an href attribute makes the page open to a wrong URL, if the user clicks that link before angular has a chance to replace the {{hash}} with actual URL, the link will be broken and will most likely return a 404 error. The ngHref directive solves this problem. +NgModelAttributeProvider_NgReadOnly=The HTML specs do not require browsers to preserve the special attributes such as readonly. (The presence of them means true and absence means false) This prevents the angular compiler from correctly retrieving the binding expression. To solve this problem, use the ngReadonly directive. +NgPluralizeAttributeProvider_Count=The variable to be bounded to. +NgPluralizeAttributeProvider_NgPluralize=ngPluralize is a directive that displays messages according to en-US localization rules. +NgPluralizeAttributeProvider_Offset=Offset to deduct from the total number. +NgPluralizeAttributeProvider_When=The mapping between plural category to its corresponding strings. +NgSubmitAttributeProvider_NgSubmit=Enables binding angular expressions to onsubmit events.

Additionally it prevents the default action (which for form means sending the request to the server and reloading the current page) but only if the form does not contain an action attribute. +NgSwitchAttributeProvider_NgSwitch=The ngSwitch directive is used to conditionally swap DOM structure on your template based on a scope expression. Elements within ngSwitch but without ngSwitchWhen or ngSwitchDefault directives will be preserved at the location as specified in the template. diff --git a/plugins/org.jboss.tools.jst.web.kb/taglibs/AngularJS.xml b/plugins/org.jboss.tools.jst.web.kb/taglibs/AngularJS.xml index 3e2499f40..5a4fe5b32 100644 --- a/plugins/org.jboss.tools.jst.web.kb/taglibs/AngularJS.xml +++ b/plugins/org.jboss.tools.jst.web.kb/taglibs/AngularJS.xml @@ -2,127 +2,189 @@ - - + + The [b]ngClick[\b] allows you to specify custom behavior when element is clicked. + + + The [b]ngClick[\b] allows you to specify custom behavior when element is clicked. + + The [b]ngBind[\b] attribute tells Angular to replace the text content of the specified HTML element with the value of a given expression, and to update the text content when the value of that expression changes. + The [b]ngBind[\b] attribute tells Angular to replace the text content of the specified HTML element with the value of a given expression, and to update the text content when the value of that expression changes. + Creates a binding that will innerHTML the result of evaluating the expression into the current element in a secure way. By default, the innerHTML-ed content will be sanitized using the $sanitize service. To utilize this functionality, ensure that $sanitize is available, for example, by including ngSanitize in your module's dependencies (not in core Angular.) You may also bypass sanitization for values you know are safe. To do so, bind to an explicitly trusted value via $sce.trustAsHtml. See the example under Strict Contextual Escaping (SCE). + Creates a binding that will innerHTML the result of evaluating the expression into the current element in a secure way. By default, the innerHTML-ed content will be sanitized using the $sanitize service. To utilize this functionality, ensure that $sanitize is available, for example, by including ngSanitize in your module's dependencies (not in core Angular.) You may also bypass sanitization for values you know are safe. To do so, bind to an explicitly trusted value via $sce.trustAsHtml. See the example under Strict Contextual Escaping (SCE). + The [b]ngBindTemplate[\b] directive specifies that the element text content should be replaced with the interpolation of the template in the [b]ngBindTemplate[\b] attribute. Unlike [b]ngBind[\b], the [b]ngBindTemplate[\b] can contain multiple {{ }} expressions. This directive is needed since some HTML elements (such as TITLE and OPTION) cannot contain SPAN elements. + The [b]ngBindTemplate[\b] directive specifies that the element text content should be replaced with the interpolation of the template in the [b]ngBindTemplate[\b] attribute. Unlike [b]ngBind[\b], the [b]ngBindTemplate[\b] can contain multiple {{ }} expressions. This directive is needed since some HTML elements (such as TITLE and OPTION) cannot contain SPAN elements. + The [b]ngClass[\b] allows you to set CSS classes on HTML an element, dynamically, by databinding an expression that represents all classes to be added. + The [b]ngClass[\b] allows you to set CSS classes on HTML an element, dynamically, by databinding an expression that represents all classes to be added. + The [b]ngClassOdd[\b] and [b]ngClassEven[\b] directives work exactly as [b]ngClass[\b], except it works in conjunction with [b]ngRepeat[\b] and takes affect only on odd (even) rows. + The [b]ngClassOdd[\b] and [b]ngClassEven[\b] directives work exactly as [b]ngClass[\b], except it works in conjunction with [b]ngRepeat[\b] and takes affect only on odd (even) rows. + The [b]ngClassOdd[\b] and [b]ngClassEven[\b] directives work exactly as [b]ngClass[\b], except it works in conjunction with [b]ngRepeat[\b] and takes affect only on odd (even) rows. + The [b]ngClassOdd[\b] and [b]ngClassEven[\b] directives work exactly as [b]ngClass[\b], except it works in conjunction with [b]ngRepeat[\b] and takes affect only on odd (even) rows. + The [b]ngCloak[\b] directive is used to prevent the Angular html template from being briefly displayed by the browser in its raw (uncompiled) form while your application is loading. Use this directive to avoid the undesirable flicker effect caused by the html template display. + The [b]ngCloak[\b] directive is used to prevent the Angular html template from being briefly displayed by the browser in its raw (uncompiled) form while your application is loading. Use this directive to avoid the undesirable flicker effect caused by the html template display. + The [b]ngController[\b] directive attaches a controller class to the view. This is a key aspect of how angular supports the principles behind the Model-View-Controller design pattern. + The [b]ngController[\b] directive attaches a controller class to the view. This is a key aspect of how angular supports the principles behind the Model-View-Controller design pattern. + The [b]ngDblclick[\b] directive allows you to specify custom behavior on [b]dblclick[\b] event. + The [b]ngDblclick[\b] directive allows you to specify custom behavior on [b]dblclick[\b] event. + Nestable alias of [b]form[\b] directive. HTML does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a sub-group of controls needs to be determined. + Nestable alias of [b]form[\b] directive. HTML does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a sub-group of controls needs to be determined. + The [b]ngShow[\b] directive shows and hides the given HTML element conditionally based on the expression provided to the [b]ngHide[\b] attribute. + The [b]ngShow[\b] directive shows and hides the given HTML element conditionally based on the expression provided to the [b]ngHide[\b] attribute. + The [b]ngIf[\b] directive removes and recreates a portion of the DOM tree (HTML) conditionally based on [b]"falsy"[\b] and [b]"truthy"[\b] values, respectively, evaluated within an {expression}. In other words, if the expression assigned to [b]ngIf evaluates to a false value[\b] then [b]the element is removed from the DOM[\b] and [b]if true[\b] then [b]a clone of the element is reinserted into the DOM[\b]. + The [b]ngIf[\b] directive removes and recreates a portion of the DOM tree (HTML) conditionally based on [b]"falsy"[\b] and [b]"truthy"[\b] values, respectively, evaluated within an {expression}. In other words, if the expression assigned to [b]ngIf evaluates to a false value[\b] then [b]the element is removed from the DOM[\b] and [b]if true[\b] then [b]a clone of the element is reinserted into the DOM[\b]. + Fetches, compiles and includes an external HTML fragment. + Fetches, compiles and includes an external HTML fragment. + The [b]ngInit[\b] directive specifies initialization tasks to be executed before the template enters execution mode during bootstrap. + The [b]ngInit[\b] directive specifies initialization tasks to be executed before the template enters execution mode during bootstrap. + This directive allows you to specify custom behavior on keydown event. + This directive allows you to specify custom behavior on keydown event. + This directive allows you to specify custom behavior on keypress event. + This directive allows you to specify custom behavior on keypress event. + This directive allows you to specify custom behavior on keyup event. + This directive allows you to specify custom behavior on keypup event. + This directive allows you to specify custom behavior on mousedown event. + This directive allows you to specify custom behavior on mousedown event. + This directive allows you to specify custom behavior on mouseenter event. + This directive allows you to specify custom behavior on mouseenter event. + This directive allows you to specify custom behavior on mouseleave event. + This directive allows you to specify custom behavior on mouseleave event. + This directive allows you to specify custom behavior on mousemove event. + This directive allows you to specify custom behavior on mousemove event. + This directive allows you to specify custom behavior on mouseover event. + This directive allows you to specify custom behavior on mouseover event. + This directive allows you to specify custom behavior on mouseup event. + This directive allows you to specify custom behavior on mouseup event. + Sometimes it is necessary to write code which looks like bindings but which should be left alone by angular. Use [b]ngNonBindable[\b] to make angular ignore a chunk of HTML. + Sometimes it is necessary to write code which looks like bindings but which should be left alone by angular. Use [b]ngNonBindable[\b] to make angular ignore a chunk of HTML. + The [b]ngRepeat[\b] directive instantiates a template once per item from a collection. Each template instance gets its own scope, where the given loop variable is set to the current collection item, and $index is set to the item index or key. + The [b]ngRepeat[\b] directive instantiates a template once per item from a collection. Each template instance gets its own scope, where the given loop variable is set to the current collection item, and $index is set to the item index or key. + The HTML specs do not require browsers to preserve the special attributes such as selected. (The presence of them means true and absence means false) This prevents the angular compiler from correctly retrieving the binding expression. To solve this problem, use the [b]ngSelected[\b] directive. + The HTML specs do not require browsers to preserve the special attributes such as selected. (The presence of them means true and absence means false) This prevents the angular compiler from correctly retrieving the binding expression. To solve this problem, use the [b]ngSelected[\b] directive. + The [b]ngShow[\b] directive shows and hides the given HTML element conditionally based on the expression provided to the [b]ngShow[\b] attribute. + The [b]ngShow[\b] directive shows and hides the given HTML element conditionally based on the expression provided to the [b]ngShow[\b] attribute. + The [b]ngStyle[\b] directive allows you to set CSS style on an HTML element conditionally. + The [b]ngStyle[\b] directive allows you to set CSS style on an HTML element conditionally. + Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion. + Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion. @@ -133,14 +195,18 @@ + Enables [b]CSP (Content Security Policy)[\b] support. + Enables [b]CSP (Content Security Policy)[\b] support. + The HTML specs do not require browsers to preserve the special attributes such as open. (The presence of them means true and absence means false) This prevents the angular compiler from correctly retrieving the binding expression. To solve this problem, use the [b]ngOpen[/b] directive. + The HTML specs do not require browsers to preserve the special attributes such as open. (The presence of them means true and absence means false) This prevents the angular compiler from correctly retrieving the binding expression. To solve this problem, use the [b]ngOpen[/b] directive. diff --git a/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/AngularJSTest.java b/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/AngularJSTest.java index b47a2fea5..0454653c6 100644 --- a/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/AngularJSTest.java +++ b/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/AngularJSTest.java @@ -204,6 +204,13 @@ public void testNgClick() { assertDirectiveProposals("click"); } + public void testNgAttributeDescription() { + KbQuery.Tag[] tags = new KbQuery.Tag[]{createTag("a")}; + KbQuery query = createKbQuery(tags, "ng-clic"); + TextProposal[] proposals = PageProcessor.getInstance().getProposals(query, context); + assertEqualDescription(proposals, "ng-click", "The ngClick allows you to specify custom behavior when element is clicked."); + } + public void testNgSubmit() { assertDirectiveProposals("form", "submit"); @@ -279,6 +286,12 @@ public void testNgBindClass() { assertClassDirective("bind"); } + public void testNgClassDescription() { + KbQuery query = createKbQuery("a", "class", "ng-bin"); + TextProposal[] proposals = PageProcessor.getInstance().getProposals(query, context); + assertEqualDescription(proposals, "ng-bind: {};", "The ngBind directive tells Angular to replace the text content of the specified HTML element with the value of a given expression, and to update the text content when the value of that expression changes."); + } + public void testNgBindHtml() { assertDirectiveProposals("bind-html"); }