在 angular material 中调整循环进度
Resize circular progress in angular material
我正在使用 Angular Material 为登录表单构建指令:
每当用户单击登录时,都会出现 circular progress 表示他现在正在登录。进度确实显示和隐藏正确,我的问题是它的大小。我希望它以相似的大小位于登录文本旁边。我尝试添加 style="transform: scale(0.5)"
或 style="width: 20px"
,但都没有影响它的大小。
如何调整进度,使其适合文本?
模板
<form name="loginForm" ng-submit="loginCtrl.login()">
<md-input-container flex>
<label for="usr">Username</label>
<input type="text" ng-disabled="login.loading" name="usr" id="usr" maxlength="50" ng-model="login.user" required />
</md-input-container>
<md-input-container flex>
<label for="pwd">Password</label>
<input type="password" ng-disabled="login.loading" name="pwd" id="pwd" ng-model="login.password" required />
</md-input-container>
<md-button class="md-raised md-primary" ng-disabled="loginForm.$invalid || login.loading" type="submit">
Login
<md-progress-circular md-mode="indeterminate" ng-show="login.loading" class="md-accent">
</md-progress-circular></md-button>
</form>
指令
angular
.module('app')
.controller('LoginCtrl', ['$scope', 'AuthService', '$log', function ($scope, AuthService, $log) {
$scope.login = {
loading: false,
password: '',
user: ''
};
this.login = function () {
$scope.login.loading = true;
// Do the login, this might take longer
AuthService.login($scope.login.user, $scope.login.password, function (data) {
$scope.login.loading = false;
if(data.success) {
$log.debug('login successful');
}
else {
$log.debug('login failed');
}
});
};
}])
.directive('loginForm', function () {
return {
restrict: 'EA',
scope: {},
controller: 'LoginCtrl',
controllerAs: 'loginCtrl',
templateUrl: '/templates/directives/loginForm.html'
};
});
我正在使用 Angular Material 为登录表单构建指令:
每当用户单击登录时,都会出现 circular progress 表示他现在正在登录。进度确实显示和隐藏正确,我的问题是它的大小。我希望它以相似的大小位于登录文本旁边。我尝试添加 style="transform: scale(0.5)"
或 style="width: 20px"
,但都没有影响它的大小。
如何调整进度,使其适合文本?
模板
<form name="loginForm" ng-submit="loginCtrl.login()">
<md-input-container flex>
<label for="usr">Username</label>
<input type="text" ng-disabled="login.loading" name="usr" id="usr" maxlength="50" ng-model="login.user" required />
</md-input-container>
<md-input-container flex>
<label for="pwd">Password</label>
<input type="password" ng-disabled="login.loading" name="pwd" id="pwd" ng-model="login.password" required />
</md-input-container>
<md-button class="md-raised md-primary" ng-disabled="loginForm.$invalid || login.loading" type="submit">
Login
<md-progress-circular md-mode="indeterminate" ng-show="login.loading" class="md-accent">
</md-progress-circular></md-button>
</form>
指令
angular
.module('app')
.controller('LoginCtrl', ['$scope', 'AuthService', '$log', function ($scope, AuthService, $log) {
$scope.login = {
loading: false,
password: '',
user: ''
};
this.login = function () {
$scope.login.loading = true;
// Do the login, this might take longer
AuthService.login($scope.login.user, $scope.login.password, function (data) {
$scope.login.loading = false;
if(data.success) {
$log.debug('login successful');
}
else {
$log.debug('login failed');
}
});
};
}])
.directive('loginForm', function () {
return {
restrict: 'EA',
scope: {},
controller: 'LoginCtrl',
controllerAs: 'loginCtrl',
templateUrl: '/templates/directives/loginForm.html'
};
});