我必须为我的AngularJs单页面应用程序加载许多文件,如angular.js,jquery.js,bootstrap.js,bootstrap.css,some_plugins.js,my_main.js等等,
加载整个应用程序需要一些时间,因此我想在void页面中显示加载指示符(例如微调器),直到所有js和css文件加载然后显示内容.
我创建了一个after_prepare钩子:
#!/usr/bin/env node
module.exports = function(context) {
... some code
console.log('Hey, a hook');
}
Run Code Online (Sandbox Code Playgroud)
当我运行时cordova build android,我在终端上看到它说它正在运行我的钩子,但似乎它没有运行module.exports函数,因为console.log没有显示在控制台中。
我正在制作单页应用程序(SPA).我创建了一个控制器InitialControler,用于从此URL(local.app/init)加载来自服务器的数据.
我希望在任何其他网址之前打开此网址.我正在使用ui-router,我$state.go('init')在.run()函数中做了一个,但它仍然在页面之前加载了请求的'init'页面
我在Android和Windows Phone 8.1上测试了我的应用程序没有任何问题,我想在iOS上测试它.
我从未测试过我的应用程序.
在购买开发者计划之前,我想先测试我的应用程序.没有(支付99美元)开发者计划,是否可以测试我的Ionic/Cordova应用程序?
如果是这样我怎么能这样做?
我想用复选框(这是一个重复列表)指令制作一个类别树.
我做了一个名为categoriesTreeContainer的指令,它包含了所有类别列表
我做了另一个名为指令categoryItem是containes分类项目这是孩子categoriesTreeContainer
这就是我所做的categoriesTreeContainer:
myApp.directive('categoriesTreeContainer', function(){
return {
restrict : 'E',
template : '<category-item ng-repeat="category in categoriesTree" category="category"></category-item>',
scope : {
categoriesTree : "=categoriestree",
selectedCategories : "=ngModel",
},
controller : function($scope, $element, $attrs){
$scope.selectedCategories = [];
$scope.onSelectionChange = function(category){
console.log('yah');
}
}
}
Run Code Online (Sandbox Code Playgroud)
})
对于categoryItem:
myApp.directive('categoryItem', function($compile){
return {
require: '^categoriesTreeContainer',
restrict : 'E',
//replace : true,
transclude : true,
scope : {
category : "=category"
},
link : function(scope, element, …Run Code Online (Sandbox Code Playgroud) I have a model that I change some attributes I want to insert it but Eloquent, after the first save() will automatically do an update while I'm using save() method, here is my code:
for ($i = 0; $i < $range; $i++) {
$model->attr = "Some new value";
$model->save(); // after the first save() will do update but I want to an insert
}
Run Code Online (Sandbox Code Playgroud)