git add .
git commit -m "Demo"
git push heroku master
heroku open
$scope.$apply();
use:
gcloud preview app deploy app.yaml --promote --docker-build=remote
dont user:
gcloud preview app deploy app.yaml --promote
doesn't work
work
from:
http://stackoverflow.com/questions/17039926/adding-parameter-to-ng-click-function-inside-ng-repeat-doesnt-seem-to-work |
https://docs.angularjs.org/api/ng/filter/date
<span ng-non-bindable>{{1288323623006 | date:'medium'}}</span>:
<span>{{1288323623006 | date:'medium'}}</span><br>
<span ng-non-bindable>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span>:
<span>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span><br>
<span ng-non-bindable>{{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}</span>:
<span>{{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}</span><br>
<span ng-non-bindable>{{1288323623006 | date:"MM/dd/yyyy 'at' h:mma"}}</span>:
<span>{{'1288323623006' | date:"MM/dd/yyyy 'at' h:mma"}}</span><br>
{{1288323623006 | date:'medium'}}: Oct 29, 2010 11:40:23 AM
{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}: 2010-10-29 11:40:23 +0800
{{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}: 10/29/2010 @ 11:40AM
{{1288323623006 | date:"MM/dd/yyyy 'at' h:mma"}}: 10/29/2010 at 11:40AM
'use strict';
var app = angular.module('app', [])
.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('/', {
templateUrl: "login.html",
controller: LoginController
})
.when('/private', {
templateUrl: "private.html",
controller: PrivateController,
resolve: {
factory: checkRouting
}
})
.when('/private/anotherpage', {
templateUrl:"another-private.html",
controller: AnotherPriveController,
resolve: {
factory: checkRouting
}
})
.otherwise({ redirectTo: '/' });
}]);
var checkRouting= function ($q, $rootScope, $location) {
if ($rootScope.userProfile) {
return true;
} else {
var deferred = $q.defer();
$http.post("/loadUserProfile", { userToken: "blah" })
.success(function (response) {
$rootScope.userProfile = response.userProfile;
deferred.resolve(true);
})
.error(function () {
deferred.reject();
$location.path("/");
});
return deferred.promise;
}
};
=========================MainCtrl
depends on $scope
and $timeout
. $scope.$emit('name', 'args');
$scope.$broadcast('name', 'args');
app.config()
app.run()
app.controller()
grunt watch
. When it detects any of the files specified have changed (here, I just use the same files I told JSHint to check), it will run the tasks you specify, in the order they appear.angular-route.js
angular.module('myApp', ['ngRoute']) .config(function($routeProvider){ $routeProvider.when("/", { templateUrl: "app.html", controller: "AppCtrl", controllerAs: "app" } ); }) .controller('AppCtrl', function() { var self = this; self.message = "The app routing is working!"; });
<h1>{{ app.message }}</h1><body ng-app="myApp"> <ng-view></ng-view> </body>