如何在Android设备上升级\转换Sqlite数据库(How to upgrade\convert a Sqlite database on an Android device)
我有一个用户报告说他有运行Android v 2.2.2的HTC Desire和运行Android v 2.3.4的HTC Flyer平板电脑。
我的应用程序在平板电脑上创建的任何数据库(Sqlite)都无法在手机上阅读。 可以在任一设备上读取在其手机上创建的任何数据库。 (希望我能以正确的方式进行,但希望你能得到这个想法)
我想这是因为数据库引擎的不同版本。 有没有办法处理这个并将一个数据库转换为与另一个数据库相同的格式,允许两个设备打开数据库,无论哪个设备创建它?
我确实找到了这个建议使用命令行进行转换的链接。 虽然对设备不是很有帮助。 http://www.sqlite.org/formatchng.html
I have a user who reports that he has a HTC Desire running Android v 2.2.2 and a HTC Flyer tablet running Android v 2.3.4.
Any databases (Sqlite) that are created by my app on his tablet cannot be read on his phone. Any databases created on his phone can be read on either device. (Hope I got that the right way round but hopefully you get the idea)
I guess this is because of different versions of the database engine. Is there a way to handle this and to convert one database to the same format as the other allowing both devices to open the database regardless of which device created it?
I did find this link which suggest using the command line to do the conversion. Not very helpful on a device though. http://www.sqlite.org/formatchng.html
原文:https://stackoverflow.com/questions/14567623
最满意答案
指令C包含在指令B中。但两个模板中唯一可见的文本位于具有指令
ng-transclude
的div内。 因此,文本内容被替换为HTML:在<dir-b>
的情况下指令C,在<dir-c>
的情况下没有任何内容。这是你的固定模板示例,告诉你它工作正常: https : //plnkr.co/edit/FRtMA3h0Caredc4staW8?p = preview
与ng-view类似,ng-transclude是一个占位符,表示:用指令体内的元素替换该元素的内容。
The directive C is included inside the directive B. But the only visible text in both templates is inside the div which has the directive
ng-transclude
. So the textual content is replaced by the transcluded HTML: the directive C in the case if<dir-b>
, and nothing in the case of<dir-c>
.Here's your example with fixed templates to show you that it works fine: https://plnkr.co/edit/FRtMA3h0Caredc4staW8?p=preview
Like ng-view, ng-transclude is a placeholder which means: replace the content of this element by the one inside the body of the directive.
相关问答
更多-
这是一个演示plunker: http ://plnkr.co/edit/ktEOsswQx3FyJ2pISqey?p=preview 你需要使用链接函数的第五个参数aka $ transclude: app.directive("chartWidget", function () { return { restrict: "A", transclude: true, templateUrl: 'chart-widget-template', ...
-
角2多槽插入(Angular 2 Multiple Slot Transclusion)[2022-11-29]
这是一个已知的问题”。 你可以通过传递来修复它 schemas: [ CUSTOM_ELEMENTS_SCHEMA ], 到@NgModule(...)明确地告诉Angular2它应该接受所有符合自定义元素名称模式的标签名称,即使当前的Angular2模块不知道这些组件。 如果你用这个选择器添加组件到directives: [...] @NgModule(...)那么Angular2也不会再抱怨了。 另请参阅https://github.com/angular/angular/issues/ ... -
角度转换(Angular Transclusion)[2023-06-02]
指令C包含在指令B中。但两个模板中唯一可见的文本位于具有指令ng-transclude的div内。 因此,文本内容被替换为HTML:在的情况下指令C,在 的情况下没有任何内容。 这是你的固定模板示例,告诉你它工作正常: https : //plnkr.co/edit/FRtMA3h0Caredc4staW8?p = preview 与ng-view类似,ng-transclude是一个占位符,表示:用指令体内的元素替换该元素的内容。 The directive C is inclu ... -
如何调用使用transclusion添加的组件功能?(How to call components function that was added using transclusion?)[2023-07-27]
我想这就是你想要的 - 使用输出事件从子节点传送到父节点: @Component({ selector: 'app-form', templateUrl: './form.component.html', styleUrls: ['./form.component.css'] }) export class FormComponent{ @Input() headerTitle:string = "Header Title"; @Input() saveBtnText: string = ... -
Angular的错误消息再一次非常明确且有用。 这个答案指出了我正确的方向。 如果'wizard-title'是Web组件,则将'CUSTOM_ELEMENTS_SCHEMA'添加到此组件的'@NgModule.schemas'以禁止显示此消息。 我不知道这个,但那些被抄袭的元素似乎是Web Components。 添加 schemas: [ CUSTOM_ELEMENTS_SCHEMA ] 我的app模块似乎解决了这个问题; 但是,我不知道为什么博客文章中的例子没有这个。 看起来您也可以为这些建议创建自 ...
-
错误很明显。 在尝试使用transclusion的相同元素上有两个指令: 1. ng-if 2. ng-include 一个元素只能应用一个变形。 要解决这个问题,可以尝试一下:
-
如何从transclude功能访问transclusion slots?(How do I access transclusion slots from the transclude function?)[2023-06-16]
我有类似的问题,但阅读ng-transclude的源代码有帮助。 原来有$ transclude函数的第三个参数,它是插槽名称。 https://github.com/angular/angular.js/blob/master/src/ng/directive/ngTransclude.js#L190 简单的例子: angular.module('app', []); angular .module('app') .directive('dir', function () { ... -
仅使用ng-click而不是href,然后调用$event.stopPropagation(); 如这里提到的。 Use ng-click only instead of href, and then call $event.stopPropagation(); as mentioned here.
-
$transclude函数必须提供给$compile 。 它被传递给link函数。 link: function(scope, elem, attrs, $transclude) { [...] if ($transclude) { // It can be undefined if not content is provided $compile(element, $transclude)(scope); } [...] } 如果您想深入了解转换业务,请点击此链接 。 The $ ...
-
transcluded元素的范围不是指令的子范围,而是兄弟范围。 这是文档说的: 在典型设置中,窗口小部件创建隔离范围,但是转换不是子项,而是隔离范围的兄弟。 在这种情况下,您可以访问transcuded范围的最简单的解决方案是这样的: .directive('pane', function () { return { restrict: 'E', transclude: true, scope: { title: '@' ...