[AC-160] Cannot use Alloy controller that does not have an associated view
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Not Our Bug |
Resolution Date | 2015-11-26T05:41:33.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Alloy |
Labels | alloy, controller, view |
Reporter | Brenton House |
Assignee | Mostafizur Rahman |
Created | 2015-06-11T15:53:47.000+0000 |
Updated | 2017-02-07T23:28:24.000+0000 |
Description
If I have a controller: mycontroller.js that does not have an associated view file: mycontroller.xml, then when I go to use that controller like this:
<Alloy>
<Require src="mycontroller"/>
</Alloy>
I get this Alloy build error:
[ERROR] view "mycontroller" does not exist.
[ERROR] The following paths were inspected:
[ERROR] c:\appc\myapp\app\views\mobileweb\mycontroller
[ERROR] c:\appc\myapp\app\views\mycontroller
[ERROR] Alloy compiler failed
Hello, We tested this issue and this doesn't seem to be a bug. Views may be included in other views using the Require element. Specify the type attribute as 'view' and the src attribute should be the view file minus the '.xml' extension, and assign a unique value to the id attribute to reference the UI objects in the controller code. If you omit the type attribute, Alloy assumes it is implicitly set to 'view’. Please refer to [this](http://docs.appcelerator.com/platform/latest/#!/guide/Alloy_XML_Markup-section-35621528_AlloyXMLMarkup-RequireElement) and [this](http://docs.appcelerator.com/platform/latest/#!/guide/Alloy_Controllers). *Testing Environment:* Appcelerator Studio, build: 4.4.0.201511182122 Appcelerator Command-Line Interface, version 5.1.0 Mac Osx: 10.9.5 Ti sdk : 5.1.0 Node.js Version = 0.12.7 Jdk: 1.7.0_65 Emulator: Samsung Galaxy S4(4.4.4) *Steps to test:* 1. Create a classic project 2. Run with the sample test case below *Test Case* index.xml
index.js
mycontroller.xml
mycontroller.js
Thanks.