How to use the knockout.observable function in knockout

To help you get started, we’ve selected a few knockout examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github paperbits / paperbits-core / src / workshops / block / ko / addBlockDialog.ts View on Github external
constructor(
        private readonly blockService: IBlockService,
        private readonly sectionModelBinder: SectionModelBinder,
        private readonly viewManager: IViewManager
    ) {
        this.addBlock = this.addBlock.bind(this);

        this.working = ko.observable(false);
        this.name = ko.observable();
        this.name.extend({ required: true });
    }
github Azure / api-management-developer-portal / src / components / users / user-details / ko / runtime / user-details.ts View on Github external
constructor(
        private readonly usersService: UsersService, 
        private readonly tenantService: TenantService,
        private readonly backendService: BackendService,
        private readonly router: Router) {
        this.user = ko.observable();
        this.firstName = ko.observable();
        this.lastName = ko.observable();
        this.email = ko.observable();
        this.password = ko.observable();
        this.confirmPassword = ko.observable();
        this.isEdit = ko.observable(false);
        this.isBasicAccount = ko.observable(false);
        this.working = ko.observable(false);
        this.registrationDate = ko.computed(() => this.getRegistrationDate());
    }
github Azure / api-management-developer-portal / src / components / users / user-signin / ko / runtime / user-signin.ts View on Github external
constructor(private readonly usersService: UsersService) {
        this.username = ko.observable("");
        this.password = ko.observable("");
        this.errorMessages = ko.observableArray([]);
        this.hasErrors = ko.observable(false);
        this.working = ko.observable(false);
        this.canSubmit = ko.pureComputed(() => {
            return !!this.username() && !!this.password() && !this.working();
        });
    }
github Azure / api-management-developer-portal / src / components / apis / details-of-api / ko / runtime / api-details.ts View on Github external
constructor(
        private readonly apiService: ApiService,
        private readonly routeHelper: RouteHelper,
        private readonly router: Router,
    ) {
        this.changeLogPageUrl = ko.observable();
        this.api = ko.observable();
        this.selectedApiName = ko.observable();
        this.versionApis = ko.observableArray([]);
        this.working = ko.observable(false);
        this.currentApiVersion = ko.observable();
        this.downloadSelected = ko.observable("");
        this.loadApi = this.loadApi.bind(this);
    }
github Azure / api-management-developer-portal / src / components / apis / list-of-apis / ko / runtime / api-list.ts View on Github external
constructor(
        private readonly apiService: ApiService,
        private readonly routeHelper: RouteHelper
    ) {
        this.detailsPageUrl = ko.observable();
        this.allowSelection = ko.observable(false);
        this.apis = ko.observableArray([]);
        this.working = ko.observable();
        this.pattern = ko.observable();
        this.page = ko.observable(1);
        this.hasPrevPage = ko.observable();
        this.hasNextPage = ko.observable();
        this.hasPager = ko.computed(() => this.hasPrevPage() || this.hasNextPage());
        this.apiGroups = ko.observableArray();
        this.groupByTag = ko.observable(false);
    }

knockout

Knockout makes it easier to create rich, responsive UIs with JavaScript

MIT
Latest version published 4 years ago

Package Health Score

62 / 100
Full package analysis